rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
return self._append(EMR.FILLPATH())
return self._append(_EMR._FILLPATH())
def FillPath(self): """
return self._append(EMR.STROKEPATH(bounds))
return self._append(_EMR._STROKEPATH(bounds))
def StrokePath(self): """
return self._append(EMR.STROKEANDFILLPATH(bounds))
return self._append(_EMR._STROKEANDFILLPATH(bounds))
def StrokeAndFillPath(self): """
return self._append(EMR.SETTEXTALIGN(alignment))
return self._append(_EMR._SETTEXTALIGN(alignment))
def SetTextAlign(self,alignment): """
e=EMR.SETTEXTCOLOR(normalizeColor(color))
e=_EMR._SETTEXTCOLOR(_normalizeColor(color))
def SetTextColor(self,color): """
return self._appendHandle(EMR.EXTCREATEFONTINDIRECTW(height,width,escapement,orientation,weight,italic,underline,strike_out,charset,out_precision,clip_precision,quality,pitch_family,name))
return self._appendHandle(_EMR._EXTCREATEFONTINDIRECTW(height,width,escapement,orientation,weight,italic,underline,strike_out,charset,out_precision,clip_precision,quality,pitch_family,name))
def CreateFont(self,height,width=0,escapement=0,orientation=0,weight=FW_NORMAL,italic=0,underline=0,strike_out=0,charset=ANSI_CHARSET,out_precision=OUT_DEFAULT_PRECIS,clip_precision=CLIP_DEFAULT_PRECIS,quality=DEFAULT_QUALITY,pitch_family='DEFAULT_PITCH|FF_DONTCARE',name='Times New Roman'): """
e=EMR.EXTTEXTOUTA(x,y,text)
e=_EMR._EXTTEXTOUTA(x,y,text)
def TextOut(self,x,y,text): """
def CreateFont(self,height,width=0,escapement=0,orientation=0,weight=FW_NORMAL,italic=0,underline=0,strike_out=0,charset=ANSI_CHARSET,out_precision=OUT_DEFAULT_PRECIS,clip_precision=CLIP_DEFAULT_PRECIS,quality=DEFAULT_QUALITY,pitch_family='DEFAULT_PITCH|FF_DONTCARE',name='Times New Roman'):
def CreateFont(self,height,width=0,escapement=0,orientation=0,weight=FW_NORMAL,italic=0,underline=0,strike_out=0,charset=ANSI_CHARSET,out_precision=OUT_DEFAULT_PRECIS,clip_precision=CLIP_DEFAULT_PRECIS,quality=DEFAULT_QUALITY,pitch_family=DEFAULT_PITCH|FF_DONTCARE,name='Times New Roman'):
def CreateFont(self,height,width=0,escapement=0,orientation=0,weight=FW_NORMAL,italic=0,underline=0,strike_out=0,charset=ANSI_CHARSET,out_precision=OUT_DEFAULT_PRECIS,clip_precision=CLIP_DEFAULT_PRECIS,quality=DEFAULT_QUALITY,pitch_family='DEFAULT_PITCH|FF_DONTCARE',name='Times New Roman'): """
txt=txt.encode('utf-16')[2:]
txt=txt.encode('utf-16le')
def serializeString(self,fh,txt): if isinstance(txt,unicode): # convert to unicode and throw away first two byte # signature. FIXME: need to check if we're on a # big-endian machine. txt=txt.encode('utf-16')[2:] fh.write(txt) extra=_round4(len(txt))-len(txt) if extra>0: fh.write('\0'*extra)
val=val.decode('utf-16')
val=val.decode('utf-16le')
def str_decode(self,typecode,name): val=_EMR_UNKNOWN.__getattr__(self,name) if name.endswith("olor"): val=self.str_color(val) elif typecode.endswith("s"): val=val.decode('utf-16') return val
self.description=txt.decode('utf-16')
self.description=txt.decode('utf-16le')
def unserializeExtra(self,data): if self.verbose: print "found %d extra bytes." % len(data)
txt.write("%s\n" % (struct.pack('16s',self.description.encode('utf-16'))))
txt.write("%s\n" % (struct.pack('16s',self.description.encode('utf-16le'))))
def str_extra(self): txt=StringIO() txt.write("\tunicode string: %s\n" % str(self.description)) txt.write("%s\n" % (struct.pack('16s',self.description.encode('utf-16')))) return txt.getvalue()
self.lfFaceName=name.decode('utf-8').encode('utf-16')[2:]
self.lfFaceName=name.decode('utf-8').encode('utf-16le')
def __init__(self,height=0,width=0,escapement=0,orientation=0, weight=FW_NORMAL,italic=0,underline=0,strike_out=0, charset=ANSI_CHARSET,out_precision=OUT_DEFAULT_PRECIS, clip_precision=CLIP_DEFAULT_PRECIS, quality=DEFAULT_QUALITY, pitch_family=DEFAULT_PITCH|FF_DONTCARE,name='Times New Roman'): _EMR_UNKNOWN.__init__(sel...
self.string=txt.encode('utf-16')[2:]
self.string=txt.encode('utf-16le')
def __init__(self,x=0,y=0,txt=""): _EMR_UNKNOWN.__init__(self) self.ptlReference_x=x self.ptlReference_y=y if isinstance(txt,unicode): self.string=txt.encode('utf-16')[2:] else: self.string=txt self.charsize=1 self.dx=[]
txt.write("\tunicode string: %s\n" % str(self.string.decode('utf-16')))
txt.write("\tunicode string: %s\n" % str(self.string.decode('utf-16le')))
def str_extra(self): txt=StringIO() txt.write("\tdx: %s\n" % str(self.dx)) if self.charsize==2: txt.write("\tunicode string: %s\n" % str(self.string.decode('utf-16'))) else: txt.write("\tascii string: %s\n" % str(self.string)) return txt.getvalue()
def __init__(self,count=0,unit=0): self.count = count
def __init__(self,count=0.0,unit=0): self.count = float(count)
def __init__(self,count=0,unit=0): self.count = count try: unit.isdigit() self.unit = counter.units[unit] except: self.unit = unit
return self.count/(1024**other.unit-self.unit) > other.count
return self.count/(1024**self.unit-other.unit) > other.count
def __gt__(self,other): if self.unit == other.unit: return self.count > other.count elif self.unit > other.unit: return self.count/(1024**other.unit-self.unit) > other.count elif other.unit > self.unit: return self.count > other.count/(1024**other.unit-self.unit)
print ifaces[iface][date]
for i in 0,1: if ifaces[iface][date][i] > value: value = ifaces[iface][date][i]
def getTheBiggest(ifaces): value = counter(0,0) for iface in ifaces.keys(): for date in ifaces[iface].keys(): #if ifaces[iface][date][i] > value: print ifaces[iface][date] # value = ifaces[iface][date][i] return value
print max
def createHTML(ifaces,templatedir,template,outdir,type): max = getTheBiggest(ifaces) #print max pass
try: image_num = int(path[0]) filename = self.remotefilelist[image_num] dest_filename = os.path.expanduser("~/.covers/" + self.remote_artist + "-" + self.remote_album + ".jpg") if os.path.exists(filename):
image_num = int(path[0]) filename = self.remotefilelist[image_num] dest_filename = os.path.expanduser("~/.covers/" + self.remote_artist + "-" + self.remote_album + ".jpg") if os.path.exists(filename): try:
def replace_cover(self, iconview, path, dialog): self.stop_art_update = True try: image_num = int(path[0]) filename = self.remotefilelist[image_num] dest_filename = os.path.expanduser("~/.covers/" + self.remote_artist + "-" + self.remote_album + ".jpg") if os.path.exists(filename): # Move temp file to actual file: os.r...
os.rename(filename, dest_filename) self.lastalbumart = None gobject.idle_add(self.update_album_art) if os.path.exists(os.path.dirname(filename)): removeall(os.path.dirname(filename)) except: pass
except: pass os.rename(filename, dest_filename) self.lastalbumart = None gobject.idle_add(self.update_album_art) if os.path.exists(os.path.dirname(filename)): removeall(os.path.dirname(filename))
def replace_cover(self, iconview, path, dialog): self.stop_art_update = True try: image_num = int(path[0]) filename = self.remotefilelist[image_num] dest_filename = os.path.expanduser("~/.covers/" + self.remote_artist + "-" + self.remote_album + ".jpg") if os.path.exists(filename): # Move temp file to actual file: os.r...
if edit_mode: self.stream_names.pop(stream_num) self.stream_uris.pop(stream_num)
def new_stream(self, action, stream_num=-1): if stream_num > -1: edit_mode = True else: edit_mode = False # Prompt user for playlist name: dialog = gtk.Dialog(None, self.window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) if edit_mode: d...
def playlists_activated(self, treeview, path, column):
def playlists_key_press(self, widget, event): if event.keyval == gtk.gdk.keyval_from_name('Return'): self.playlists_activated(widget, widget.get_cursor()[0]) return True def playlists_activated(self, treeview, path, column=0): if self.status: playid = self.status.playlistlength
def playlists_activated(self, treeview, path, column): self.add_item(None)
def streams_activated(self, treeview, path, column):
if self.play_on_activate: self.play_item(playid) def streams_key_press(self, widget, event): if event.keyval == gtk.gdk.keyval_from_name('Return'): self.streams_activated(widget, widget.get_cursor()[0]) return True def streams_activated(self, treeview, path, column=0): if self.status: playid = self.status.playlistlen...
def playlists_activated(self, treeview, path, column): self.add_item(None)
else:
elif root != self.browser.wd:
def browse(self, widget=None, root='/'): if not self.conn: return
self.browser_refreshed_after_save = True
if len(prev_selection) > 0 or prev_selection_root or prev_selection_parent: self.browser_retain_preupdate_selection(prev_selection, prev_selection_root, prev_selection_parent) def browser_retain_preupdate_selection(self, prev_selection, prev_selection_root, prev_selection_parent): for value in prev_selection: for rown...
def browse(self, widget=None, root='/'): if not self.conn: return
self.conn.do.add(model.get_value(model.get_iter(path), 2))
item = model.get_value(model.get_iter(path), 2) self.stream_parse_and_add(item)
def add_item(self, widget): if self.conn: if self.notebook.get_current_page() == self.TAB_LIBRARY: # Library model, selected = self.browser_selection.get_selected_rows() if self.root == "/": if len(selected) == len(self.browserdata): # Everything selected, this is faster.. self.conn.do.add(self.root) else: for path in ...
if HAVE_STATUS_ICON: self.statusicon.set_tooltip(newlabel_tray_gtk)
def update_cursong(self): if self.conn and self.status and self.status.state in ['play', 'pause']: # We must show the trayprogressbar and trayalbumeventbox # before changing self.cursonglabel (and consequently calling # self.labelnotify()) in order to ensure that the notification # popup will have the correct height wh...
else: iters = [model.get_iter(path) for path in selected] for iter in iters: self.conn.do.deleteid(self.currentdata.get_value(iter, 0))
elif len(selected) > 0: for path in selected: self.conn.do.deleteid(self.currentdata.get_value(model.get_iter(path), 0))
def remove(self, widget): if self.conn: page_num = self.notebook.get_current_page() if page_num == self.TAB_CURRENT: model, selected = self.current_selection.get_selected_rows() if len(selected) == len(self.currentdata): # Everything is selected, clear: self.conn.do.clear() else: iters = [model.get_iter(path) for path ...
table3.attach(gtk.Label(), 1, 3, 13, 14, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 15, 0)
table3.attach(activate, 1, 3, 13, 14, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0)
def prefs(self, widget): prefswindow = gtk.Dialog(_("Preferences"), self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT) prefswindow.set_resizable(False) prefswindow.set_has_separator(False) hbox = gtk.HBox() prefsnotebook = gtk.Notebook() # MPD tab table = gtk.Table(9, 2, False) table.set_col_spacings(3) mpdlabel = gtk....
self.saving_tag = False editwindow.connect('response', self.editwindow_response, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton) titlebutton.connect('clicked', self.editwindow_applyall, "title", filetags, titleentry, artistentry, albumentr...
self.edit_style_orig = titleentry.get_style() entries = [titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, fileentry] buttons = [titlebutton, artistbutton, albumbutton, yearbutton, trackbutton, genrebutton, commentbutton] entries_names = ["title", "artist", "album", "year", "track", ...
def edit_tags(self, widget): if not os.path.isdir(self.musicdir): error_dialog = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, _("The path") + " " + self.musicdir + " " + _("does not exist. Please specify a valid music directory in preferences.")) error_dialog.set_title(_("Edi...
self.tooltips.set_tip(button, _("Increment each selected music file starting at track 1."))
self.tooltips.set_tip(button, _("Increment each selected music file, starting at track 1 for this file."))
def editwindow_create_applyall_button(self, button, vbox, entry, autotrack=False): button.set_size_request(12, 12) if autotrack: self.tooltips.set_tip(button, _("Increment each selected music file starting at track 1.")) else: self.tooltips.set_tip(button, _("Apply to all selected music files.")) padding = int((entry.s...
def editwindow_applyall(self, button, item, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry):
def editwindow_applyall(self, button, item, filetags, tag_changed, entries):
def editwindow_applyall(self, button, item, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry): filetagnum = 0 for filetag in filetags: filetagnum = filetagnum + 1 if item == "title": filetag.tag().title = titleentry.get_text() elif item == "album": filetag.tag().album = alb...
filetag.tag().title = titleentry.get_text()
filetag.tag().title = entries[0].get_text()
def editwindow_applyall(self, button, item, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry): filetagnum = 0 for filetag in filetags: filetagnum = filetagnum + 1 if item == "title": filetag.tag().title = titleentry.get_text() elif item == "album": filetag.tag().album = alb...
filetag.tag().album = albumentry.get_text()
filetag.tag().album = entries[2].get_text()
def editwindow_applyall(self, button, item, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry): filetagnum = 0 for filetag in filetags: filetagnum = filetagnum + 1 if item == "title": filetag.tag().title = titleentry.get_text() elif item == "album": filetag.tag().album = alb...
filetag.tag().artist = artistentry.get_text()
filetag.tag().artist = entries[1].get_text()
def editwindow_applyall(self, button, item, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry): filetagnum = 0 for filetag in filetags: filetagnum = filetagnum + 1 if item == "title": filetag.tag().title = titleentry.get_text() elif item == "album": filetag.tag().album = alb...
if len(yearentry.get_text()) > 0: filetag.tag().year = int(yearentry.get_text())
if len(entries[3].get_text()) > 0: filetag.tag().year = int(entries[3].get_text())
def editwindow_applyall(self, button, item, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry): filetagnum = 0 for filetag in filetags: filetagnum = filetagnum + 1 if item == "title": filetag.tag().title = titleentry.get_text() elif item == "album": filetag.tag().album = alb...
filetag.tag().track = filetagnum
if filetagnum >= self.filetagnum: filetag.tag().track = filetagnum - self.filetagnum + 1 else: filetag.tag().track = 0
def editwindow_applyall(self, button, item, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry): filetagnum = 0 for filetag in filetags: filetagnum = filetagnum + 1 if item == "title": filetag.tag().title = titleentry.get_text() elif item == "album": filetag.tag().album = alb...
filetag.tag().genre = genreentry.get_text()
filetag.tag().genre = entries[5].get_text()
def editwindow_applyall(self, button, item, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry): filetagnum = 0 for filetag in filetags: filetagnum = filetagnum + 1 if item == "title": filetag.tag().title = titleentry.get_text() elif item == "album": filetag.tag().album = alb...
filetag.tag().comment = commententry.get_text()
filetag.tag().comment = entries[6].get_text()
def editwindow_applyall(self, button, item, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry): filetagnum = 0 for filetag in filetags: filetagnum = filetagnum + 1 if item == "title": filetag.tag().title = titleentry.get_text() elif item == "album": filetag.tag().album = alb...
trackentry.set_text(str(filetags[self.filetagnum].tag().track))
entries[4].set_text(str(filetags[self.filetagnum].tag().track))
def editwindow_applyall(self, button, item, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry): filetagnum = 0 for filetag in filetags: filetagnum = filetagnum + 1 if item == "title": filetag.tag().title = titleentry.get_text() elif item == "album": filetag.tag().album = alb...
def editwindow_update(self, window, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton): titleentry.set_text(filetags[self.filetagnum].tag().title) titleentry.select_region(0, len(titleentry.get_text())) artistentry.set_text(filetags[self.file...
def editwindow_update(self, window, filetags, mpdpaths, savebutton, tag_changed, entries, entries_names): self.updating_edit_entries = True entries[0].set_text(filetags[self.filetagnum].tag().title) entries[0].select_region(0, len(entries[0].get_text())) entries[0].grab_focus() entries[1].set_text(filetags[self.filetag...
def editwindow_update(self, window, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton): titleentry.set_text(filetags[self.filetagnum].tag().title) titleentry.select_region(0, len(titleentry.get_text())) artistentry.set_text(filetags[self.file...
yearentry.set_text(str(filetags[self.filetagnum].tag().year))
entries[3].set_text(str(filetags[self.filetagnum].tag().year))
def editwindow_update(self, window, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton): titleentry.set_text(filetags[self.filetagnum].tag().title) titleentry.select_region(0, len(titleentry.get_text())) artistentry.set_text(filetags[self.file...
trackentry.set_text(str(filetags[self.filetagnum].tag().track)) genreentry.set_text(filetags[self.filetagnum].tag().genre) commententry.set_text(filetags[self.filetagnum].tag().comment) fileentry.set_text(mpdpaths[self.filetagnum].split('/')[-1])
entries[4].set_text(str(filetags[self.filetagnum].tag().track)) entries[5].set_text(filetags[self.filetagnum].tag().genre) entries[6].set_text(filetags[self.filetagnum].tag().comment) entries[7].set_text(mpdpaths[self.filetagnum].split('/')[-1])
def editwindow_update(self, window, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton): titleentry.set_text(filetags[self.filetagnum].tag().title) titleentry.select_region(0, len(titleentry.get_text())) artistentry.set_text(filetags[self.file...
titleentry.grab_focus()
def editwindow_update(self, window, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton): titleentry.set_text(filetags[self.filetagnum].tag().title) titleentry.select_region(0, len(titleentry.get_text())) artistentry.set_text(filetags[self.file...
def editwindow_response(self, window, response, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton):
self.updating_edit_entries = False for i in range(len(entries)-1): if tag_changed[self.filetagnum][entries_names[i]]: self.edit_entry_changed(entries[i]) else: self.edit_entry_revert_color(entries[i], entries[len(entries)-1]) def editwindow_response(self, window, response, filetags, mpdpaths, savebutton, tag_changed,...
def editwindow_update(self, window, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton): titleentry.set_text(filetags[self.filetagnum].tag().title) titleentry.select_region(0, len(titleentry.get_text())) artistentry.set_text(filetags[self.file...
while savebutton.get_property("sensitive") == True:
while savebutton.get_property("sensitive") == True or gtk.events_pending():
def editwindow_response(self, window, response, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton): if response == gtk.RESPONSE_REJECT: self.editwindow_hide(window) elif response == gtk.RESPONSE_ACCEPT: savebutton.set_sensitive(False) while s...
filetags[self.filetagnum].tag().title = titleentry.get_text() filetags[self.filetagnum].tag().artist = artistentry.get_text() filetags[self.filetagnum].tag().album = albumentry.get_text() if len(yearentry.get_text()) > 0: filetags[self.filetagnum].tag().year = int(yearentry.get_text())
filetags[self.filetagnum].tag().title = entries[0].get_text() filetags[self.filetagnum].tag().artist = entries[1].get_text() filetags[self.filetagnum].tag().album = entries[2].get_text() if len(entries[3].get_text()) > 0: filetags[self.filetagnum].tag().year = int(entries[3].get_text())
def editwindow_response(self, window, response, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton): if response == gtk.RESPONSE_REJECT: self.editwindow_hide(window) elif response == gtk.RESPONSE_ACCEPT: savebutton.set_sensitive(False) while s...
if len(trackentry.get_text()) > 0: filetags[self.filetagnum].tag().track = int(trackentry.get_text())
if len(entries[4].get_text()) > 0: filetags[self.filetagnum].tag().track = int(entries[4].get_text())
def editwindow_response(self, window, response, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton): if response == gtk.RESPONSE_REJECT: self.editwindow_hide(window) elif response == gtk.RESPONSE_ACCEPT: savebutton.set_sensitive(False) while s...
filetags[self.filetagnum].tag().genre = genreentry.get_text() filetags[self.filetagnum].tag().comment = commententry.get_text()
filetags[self.filetagnum].tag().genre = entries[5].get_text() filetags[self.filetagnum].tag().comment = entries[6].get_text()
def editwindow_response(self, window, response, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton): if response == gtk.RESPONSE_REJECT: self.editwindow_hide(window) elif response == gtk.RESPONSE_ACCEPT: savebutton.set_sensitive(False) while s...
self.editwindow_update(window, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton)
self.editwindow_update(window, filetags, mpdpaths, savebutton, tag_changed, entries, entries_names)
def editwindow_response(self, window, response, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton): if response == gtk.RESPONSE_REJECT: self.editwindow_hide(window) elif response == gtk.RESPONSE_ACCEPT: savebutton.set_sensitive(False) while s...
self.exit()
sys.exit()
def __init__(self):
self.current.get_selection().set_mode(gtk.SELECTION_MULTIPLE)
self.current_selection.set_mode(gtk.SELECTION_MULTIPLE)
def __init__(self):
self.playlists.get_selection().set_mode(gtk.SELECTION_MULTIPLE)
self.playlists_selection.set_mode(gtk.SELECTION_MULTIPLE)
def __init__(self):
self.streams.get_selection().set_mode(gtk.SELECTION_MULTIPLE)
self.streams_selection.set_mode(gtk.SELECTION_MULTIPLE)
def __init__(self):
self.browser.get_selection().set_mode(gtk.SELECTION_MULTIPLE)
self.browser_selection.set_mode(gtk.SELECTION_MULTIPLE)
def __init__(self):
self.notebook.connect('switch-page', self.notebook_tab_clicked)
def __init__(self):
self.notebook_tab_clicked(self.notebook, 0, self.notebook.get_current_page()) def notebook_tab_clicked(self, notebook, page, page_num): if page_num == self.TAB_CURRENT: gobject.idle_add(self.give_widget_focus, self.current) elif page_num == self.TAB_LIBRARY: gobject.idle_add(self.give_widget_focus, self.browser) elif ...
self.on_notebook_page_change(self.notebook, 0, self.notebook.get_current_page())
def handle_change_conn(self): if not self.conn: self.ppbutton.set_property('sensitive', False) self.stopbutton.set_property('sensitive', False) self.prevbutton.set_property('sensitive', False) self.nextbutton.set_property('sensitive', False) self.volumebutton.set_property('sensitive', False) try: self.trayimage.set_fro...
model, selected = self.streams.get_selection().get_selected_rows()
model, selected = self.streams_selection.get_selected_rows()
def edit_stream(self, action): model, selected = self.streams.get_selection().get_selected_rows() try: streamname = model.get_value(model.get_iter(selected[0]), 1) for i in range(len(self.stream_names)): if self.stream_names[i] == streamname: self.new_stream(action, i) return except: pass
model, rows = self.browser.get_selection().get_selected_rows()
model, rows = self.browser_selection.get_selected_rows()
def browse(self, widget=None, root='/'): if not self.conn: return
self.browser.get_selection().select_path(self.browserselectedpath[self.browser.wd])
self.browser_selection.select_path(self.browserselectedpath[self.browser.wd])
def browser_set_view(self): try: if self.browser.wd in self.browserposition: self.browser.scroll_to_point(0, self.browserposition[self.browser.wd]) else: self.browser.scroll_to_point(0, 0) except: self.browser.scroll_to_point(0, 0)
self.set_menu_contextual_items_visible()
def browser_button_press(self, widget, event): self.volume_hide() if event.button == 3: self.set_menu_contextual_items_visible() self.mainmenu.popup(None, None, None, event.button, event.time) # Don't change the selection for a right-click. This # will allow the user to select multiple rows and then # right-click (inst...
if self.browser.get_selection().count_selected_rows() > 1:
if self.browser_selection.count_selected_rows() > 1:
def browser_button_press(self, widget, event): self.volume_hide() if event.button == 3: self.set_menu_contextual_items_visible() self.mainmenu.popup(None, None, None, event.button, event.time) # Don't change the selection for a right-click. This # will allow the user to select multiple rows and then # right-click (inst...
self.set_menu_contextual_items_visible()
def playlists_button_press(self, widget, event): self.volume_hide() if event.button == 3: self.set_menu_contextual_items_visible() self.mainmenu.popup(None, None, None, event.button, event.time) # Don't change the selection for a right-click. This # will allow the user to select multiple rows and then # right-click (in...
if self.playlists.get_selection().count_selected_rows() > 1:
if self.playlists_selection.count_selected_rows() > 1:
def playlists_button_press(self, widget, event): self.volume_hide() if event.button == 3: self.set_menu_contextual_items_visible() self.mainmenu.popup(None, None, None, event.button, event.time) # Don't change the selection for a right-click. This # will allow the user to select multiple rows and then # right-click (in...
self.set_menu_contextual_items_visible()
def streams_button_press(self, widget, event): self.volume_hide() if event.button == 3: self.set_menu_contextual_items_visible() self.mainmenu.popup(None, None, None, event.button, event.time) # Don't change the selection for a right-click. This # will allow the user to select multiple rows and then # right-click (inst...
if self.streams.get_selection().count_selected_rows() > 1:
if self.streams_selection.count_selected_rows() > 1:
def streams_button_press(self, widget, event): self.volume_hide() if event.button == 3: self.set_menu_contextual_items_visible() self.mainmenu.popup(None, None, None, event.button, event.time) # Don't change the selection for a right-click. This # will allow the user to select multiple rows and then # right-click (inst...
model, selected = self.browser.get_selection().get_selected_rows()
model, selected = self.browser_selection.get_selected_rows()
def add_item(self, widget): if self.conn: if self.notebook.get_current_page() == self.TAB_LIBRARY: # Library model, selected = self.browser.get_selection().get_selected_rows() if self.root == "/": for path in selected: self.conn.do.add(model.get_value(model.get_iter(path), 1)) else: iters = [] for path in selected: if ...
model, selected = self.playlists.get_selection().get_selected_rows()
model, selected = self.playlists_selection.get_selected_rows()
def add_item(self, widget): if self.conn: if self.notebook.get_current_page() == self.TAB_LIBRARY: # Library model, selected = self.browser.get_selection().get_selected_rows() if self.root == "/": for path in selected: self.conn.do.add(model.get_value(model.get_iter(path), 1)) else: iters = [] for path in selected: if ...
model, selected = self.streams.get_selection().get_selected_rows()
model, selected = self.streams_selection.get_selected_rows()
def add_item(self, widget): if self.conn: if self.notebook.get_current_page() == self.TAB_LIBRARY: # Library model, selected = self.browser.get_selection().get_selected_rows() if self.root == "/": for path in selected: self.conn.do.add(model.get_value(model.get_iter(path), 1)) else: iters = [] for path in selected: if ...
num_selected = self.browser.get_selection().count_selected_rows()
num_selected = self.browser_selection.count_selected_rows()
def replace_item(self, widget): play_after_replace = False if self.status and self.status.state == 'play': play_after_replace = True # Only clear if an item is selected: if self.notebook.get_current_page() == self.TAB_LIBRARY: num_selected = self.browser.get_selection().count_selected_rows() elif self.notebook.get_curr...
num_selected = self.playlists.get_selection().count_selected_rows()
num_selected = self.playlists_selection.count_selected_rows()
def replace_item(self, widget): play_after_replace = False if self.status and self.status.state == 'play': play_after_replace = True # Only clear if an item is selected: if self.notebook.get_current_page() == self.TAB_LIBRARY: num_selected = self.browser.get_selection().count_selected_rows() elif self.notebook.get_curr...
num_selected = self.streams.get_selection().count_selected_rows()
num_selected = self.streams_selection.count_selected_rows()
def replace_item(self, widget): play_after_replace = False if self.status and self.status.state == 'play': play_after_replace = True # Only clear if an item is selected: if self.notebook.get_current_page() == self.TAB_LIBRARY: num_selected = self.browser.get_selection().count_selected_rows() elif self.notebook.get_curr...
self.set_menu_contextual_items_visible()
def menukey_press(self, action): self.set_menu_contextual_items_visible() self.mainmenu.popup(None, None, self.position_menu, 0, 0)
foobar, self._selected = self.current.get_selection().get_selected_rows()
foobar, self._selected = self.current_selection.get_selected_rows()
def on_drag_drop(self, treeview, drag_context, x, y, selection, info, timestamp): model = treeview.get_model() foobar, self._selected = self.current.get_selection().get_selected_rows() data = pickle.loads(selection.data) drop_info = treeview.get_dest_row_at_pos(x, y)
model, selected = self.current.get_selection().get_selected_rows()
model, selected = self.current_selection.get_selected_rows()
def current_data_get(self, widget, drag_context, selection, info, timestamp): model, selected = self.current.get_selection().get_selected_rows() selection.set(selection.target, 8, pickle.dumps(selected)) return
self.set_menu_contextual_items_visible()
def current_button_press(self, widget, event): self.volume_hide() if event.button == 3: self.set_menu_contextual_items_visible() self.mainmenu.popup(None, None, None, event.button, event.time) # Don't change the selection for a right-click. This # will allow the user to select multiple rows and then # right-click (inst...
if self.current.get_selection().count_selected_rows() > 1:
if self.current_selection.count_selected_rows() > 1:
def current_button_press(self, widget, event): self.volume_hide() if event.button == 3: self.set_menu_contextual_items_visible() self.mainmenu.popup(None, None, None, event.button, event.time) # Don't change the selection for a right-click. This # will allow the user to select multiple rows and then # right-click (inst...
self.set_menu_contextual_items_visible()
def current_popup_menu(self, widget): self.set_menu_contextual_items_visible() self.mainmenu.popup(None, None, None, 3, 0)
model, selected = self.browser.get_selection().get_selected_rows()
model, selected = self.browser_selection.get_selected_rows()
def updatedb_path(self, action): if self.conn: if self.notebook.get_current_page() == self.TAB_LIBRARY: model, selected = self.browser.get_selection().get_selected_rows() iters = [model.get_iter(path) for path in selected] if len(iters) > 0: # If there are selected rows, update these paths.. for iter in iters: self.con...
model, selected = self.current.get_selection().get_selected_rows()
model, selected = self.current_selection.get_selected_rows()
def remove(self, widget): if self.conn: page_num = self.notebook.get_current_page() if page_num == self.TAB_CURRENT: model, selected = self.current.get_selection().get_selected_rows() iters = [model.get_iter(path) for path in selected] for iter in iters: self.conn.do.deleteid(self.currentdata.get_value(iter, 0)) elif p...
model, selected = self.playlists.get_selection().get_selected_rows()
model, selected = self.playlists_selection.get_selected_rows()
def remove(self, widget): if self.conn: page_num = self.notebook.get_current_page() if page_num == self.TAB_CURRENT: model, selected = self.current.get_selection().get_selected_rows() iters = [model.get_iter(path) for path in selected] for iter in iters: self.conn.do.deleteid(self.currentdata.get_value(iter, 0)) elif p...
model, selected = self.streams.get_selection().get_selected_rows()
model, selected = self.streams_selection.get_selected_rows()
def remove(self, widget): if self.conn: page_num = self.notebook.get_current_page() if page_num == self.TAB_CURRENT: model, selected = self.current.get_selection().get_selected_rows() iters = [model.get_iter(path) for path in selected] for iter in iters: self.conn.do.deleteid(self.currentdata.get_value(iter, 0)) elif p...
if self.streamsdata.get_value(iter, 1) == escape_html(self.stream_names[i]): self.stream_names.pop(i) self.stream_uris.pop(i)
if not stream_removed: if self.streamsdata.get_value(iter, 1) == escape_html(self.stream_names[i]): self.stream_names.pop(i) self.stream_uris.pop(i) stream_removed = True
def remove(self, widget): if self.conn: page_num = self.notebook.get_current_page() if page_num == self.TAB_CURRENT: model, selected = self.current.get_selection().get_selected_rows() iters = [model.get_iter(path) for path in selected] for iter in iters: self.conn.do.deleteid(self.currentdata.get_value(iter, 0)) elif p...
self.UIManager.get_widget('/mainmenu/removemenu/').show()
if self.current_selection.count_selected_rows() > 0: self.UIManager.get_widget('/mainmenu/removemenu/').show()
def set_menu_contextual_items_visible(self): self.set_menu_contextual_items_hidden() if not self.expanded: return elif self.notebook.get_current_page() == self.TAB_CURRENT: self.UIManager.get_widget('/mainmenu/removemenu/').show() self.UIManager.get_widget('/mainmenu/clearmenu/').show() self.UIManager.get_widget('/main...
self.UIManager.get_widget('/mainmenu/addmenu/').show() self.UIManager.get_widget('/mainmenu/replacemenu/').show()
if self.browser_selection.count_selected_rows() > 0: self.UIManager.get_widget('/mainmenu/addmenu/').show() self.UIManager.get_widget('/mainmenu/replacemenu/').show()
def set_menu_contextual_items_visible(self): self.set_menu_contextual_items_hidden() if not self.expanded: return elif self.notebook.get_current_page() == self.TAB_CURRENT: self.UIManager.get_widget('/mainmenu/removemenu/').show() self.UIManager.get_widget('/mainmenu/clearmenu/').show() self.UIManager.get_widget('/main...
else: self.UIManager.get_widget('/mainmenu/addmenu/').show() self.UIManager.get_widget('/mainmenu/replacemenu/').show() self.UIManager.get_widget('/mainmenu/rmmenu/').show() if self.notebook.get_current_page() == self.TAB_STREAMS: self.UIManager.get_widget('/mainmenu/newmenu/').show() self.UIManager.get_widget('/mainme...
elif self.notebook.get_current_page() == self.TAB_PLAYLISTS: if self.playlists_selection.count_selected_rows() > 0: self.UIManager.get_widget('/mainmenu/addmenu/').show() self.UIManager.get_widget('/mainmenu/replacemenu/').show() self.UIManager.get_widget('/mainmenu/rmmenu/').show() elif self.notebook.get_current_page(...
def set_menu_contextual_items_visible(self): self.set_menu_contextual_items_hidden() if not self.expanded: return elif self.notebook.get_current_page() == self.TAB_CURRENT: self.UIManager.get_widget('/mainmenu/removemenu/').show() self.UIManager.get_widget('/mainmenu/clearmenu/').show() self.UIManager.get_widget('/main...
self.set_image_for_cover(self.musicdir + songdir + "/" + self.single_img_in_dir)
self.set_image_for_cover(self.musicdir + songdir + "/" + self.single_img_in_dir, use_threads_star)
def check_local_images(self, songdir, use_threads_star): if os.path.exists(self.musicdir + songdir + "/cover.jpg"): self.set_image_for_cover(self.musicdir + songdir + "/cover.jpg", use_threads_star) elif os.path.exists(self.musicdir + songdir + "/folder.jpg"): self.set_image_for_cover(self.musicdir + songdir + "/folder...
if os.path.splitext(file)[1].replace(".","") in i['extensions']:
if os.path.splitext(file)[1].replace(".","").lower in i['extensions']:
def get_single_img_in_path(self, songdir): single_img = None for file in os.listdir(self.musicdir + songdir): # Check against gtk+ supported image formats for i in gtk.gdk.pixbuf_get_formats(): if os.path.splitext(file)[1].replace(".","") in i['extensions']: if single_img == None: single_img = file else: return False r...
while gtk.events_pending(): gtk.main_iteration()
def withdraw_app_toggle(self, action): if self.ignore_toggle_signal: return self.ignore_toggle_signal = True if self.UIManager.get_widget('/traymenu/showmenu').get_active() == True: self.withdraw_app_undo() else: self.withdraw_app() while gtk.events_pending(): gtk.main_iteration() gobject.timeout_add(500, self.set_igno...
('savemenu', gtk.STOCK_SAVE, _('_Save Playlist...'), '<Ctrl>s', None, self.save_playlist),
('savemenu', gtk.STOCK_SAVE, _('_Save Playlist...'), '<Ctrl><Shift>s', None, self.save_playlist),
def __init__(self):
('addmenu', gtk.STOCK_ADD, _('_Add'), 'space', None, self.add_item),
('addmenu', gtk.STOCK_ADD, _('_Add'), '<Ctrl>d', None, self.add_item),
def __init__(self):
('deletekey', None, 'Delete Key', 'Delete', None, self.remove),
def __init__(self):
('updatekey2', None, 'Update Key 2', '<Ctrl><Shift>u', None, self.updatedb_path), ('parentdirkey', None, 'Parent Dir Key', 'BackSpace', None, self.parent_dir), ('hidewinkey', None, 'Hide Window Key', 'Escape', None, self.withdraw_app)
('updatekey2', None, 'Update Key 2', '<Ctrl><Shift>u', None, self.updatedb_path)
def __init__(self):
<menuitem action="deletekey"/>
def __init__(self):
<menuitem action="parentdirkey"/> <menuitem action="hidewinkey"/>
def __init__(self):
browervbox = gtk.VBox()
def __init__(self):
browservbox.pack_start(self.browser, True, True, 2) browerhbox = gtk.HBox() self.searchbutton = gtk.ToggleButton(_('_Search')) self.searchcombo = gtk.ComboBox()
self.expanderwindow2.add(self.browser) self.searchbox = gtk.HBox() if not self.show_search: self.searchbox.hide() self.searchbox.set_no_show_all(True) self.searchcombo = gtk.combo_box_new_text() self.searchcombo.append_text(_('Artist')) self.searchcombo.append_text(_('Title')) self.searchcombo.append_text(_('Album')) s...
def __init__(self):
browserhbox.pack_start(self.searchbutton, False, False, 2) browserhbox.pack_start(self.searchcombo, False, False, 2) browserhbox.pack_start(self.searchtext, True, True, 2) browservbox.pack_start(browserhbox, False, False, 2) self.expanderwindow2.add(browservbox)
self.searchbutton = gtk.Button(_('_End Search')) self.searchbutton.set_image(gtk.image_new_from_stock(gtk.STOCK_CANCEL, gtk.ICON_SIZE_SMALL_TOOLBAR)) self.searchbutton.set_size_request(-1, self.searchcombo.size_request()[1]) self.searchbutton.set_no_show_all(True) self.searchbutton.hide() self.searchbox.pack_start(self...
def __init__(self):
self.notebook.append_page(self.expanderwindow2, libraryhbox)
self.notebook.append_page(browservbox, libraryhbox)
def __init__(self):