rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
if event == rc.K1: | elif event == rc.K1: | def eventhandler(self, event): """ eventhandler for mplayer control. If an event is not bound in this function it will be passed over to the items eventhandler """ |
nlist = map(lambda x, key=key: (int(x[key][1][0]), x), list) | nlist = map(lambda x, key=key: (string.split(x[key][1][0])[0], x), list) | def sortchannels(list, key): # This should be more generic, but I couldn't get it # to sort properly without specifying the nested array # index for the tunerid and forcing 'int' for l in list: if len(l[key]) == 1: l[key].append(('0',)) nlist = map(lambda x, key=key: (int(x[key][1][0]), x), list) nlist.sort() return ma... |
tunerid = a['display-name'][1][0].encode(LOCALE, 'ignore') | tunerid = string.split(a['display-name'][1][0].encode(LOCALE, 'ignore'))[0] | def detect_channels(): """ Auto detect a list of possible channels in the xmltv file """ import codecs import cPickle, pickle file = XMLTV_FILE path = FREEVO_CACHEDIR pfile = 'xmltv_channels.pickle' pname = os.path.join(path,pfile) if not os.path.isfile(file): if not HELPER: print print 'Error: can\'t find %s' % fil... |
tunerid = a['display-name'][0][0].encode(LOCALE, 'ignore') | tunerid = string.split(a['display-name'][0][0].encode(LOCALE, 'ignore'))[0] | def detect_channels(): """ Auto detect a list of possible channels in the xmltv file """ import codecs import cPickle, pickle file = XMLTV_FILE path = FREEVO_CACHEDIR pfile = 'xmltv_channels.pickle' pname = os.path.join(path,pfile) if not os.path.isfile(file): if not HELPER: print print 'Error: can\'t find %s' % fil... |
chanlist += [(id,display_name,int(tunerid))] | chanlist += [(id,display_name,tunerid)] | def detect_channels(): """ Auto detect a list of possible channels in the xmltv file """ import codecs import cPickle, pickle file = XMLTV_FILE path = FREEVO_CACHEDIR pfile = 'xmltv_channels.pickle' pname = os.path.join(path,pfile) if not os.path.isfile(file): if not HELPER: print print 'Error: can\'t find %s' % fil... |
value = self.parent[key] if value: return value == 'yes' | if isinstance(self.parent, DirItem): return self.parent[key] | def __getitem__(self, key): """ return the specific attribute """ if key == 'type': return _('Directory') |
if ((occupied_size + char_size) <= width) and (string[i] != '\n'): | if ((occupied_size + char_size + ellipse_size) <= width) and (string[i] != '\n'): | def drawstringframedhard(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top', layer=None, ellipses='...'): |
tmp_size, tmp_height = self.stringsize('...', font, ptsize) | def drawstringframedhard(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top', layer=None, ellipses='...'): | |
if (occupied_size + tmp_size) <= width: break char_size, char_height = self.charsize(lines[line_number][len_line-j-1], font, ptsize) | if (occupied_size + ellipse_size) <= width: break char_size = self.charsize(lines[line_number][len_line-j-1], font, ptsize)[0] | def drawstringframedhard(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top', layer=None, ellipses='...'): |
fv.tableCell(p.channel.title, 'class="'+status+'" colspan="1"') fv.tableCell(p.title, 'class="'+status+'" colspan="1"') fv.tableCell(p.subtitle, 'class="'+status+'" colspan="1"') | fv.tableCell(Unicode(p.channel.title), 'class="'+status+'" colspan="1"') fv.tableCell(Unicode(p.title), 'class="'+status+'" colspan="1"') fv.tableCell(Unicode(p.subtitle), 'class="'+status+'" colspan="1"') | def render(self, request): fv = HTMLResource() form = request.query by_chan = None |
log.info(self.jobs[0][0]) | log.debug(self.jobs[0][0]) | def create(self): log.info(self.jobs[0][0]) create(self.jobs[0][0]) if self.jobs: return True else: return False |
if (osd.sdl_driver == 'dxr3'): if DEBUG: print "Stopping Display for Video Playback on DXR3" osd.stopdisplay() | def run(self): while 1: if self.mode == 'idle': self.mode_flag.wait() self.mode_flag.clear() elif self.mode == 'play': | |
if config.XINE_VERSION < '0.99.1' and \ config.XINE_VERSION < '0.9.23': self.reason = "'xine' version too old" return if config.FBXINE_VERSION < '0.99.1' and \ config.FBXINE_VERSION < '0.9.23': self.reason = "'fbxine' version too old" return | def __init__(self): # detect xine and it's version config.detect('xine') | |
command.append('%s | if self.timeshift: tsfile = os.path.join(self.timeshift_dir, self.timeshift_file) if os.path.exists(tsfile): os.remove(tsfile) command.append('%s else: command.append('%s | def __receive_url(self, result): if isinstance(result, mbus.types.MError): log.error(str(result)) return if not result.appStatus: log.error(str(result.appDescription)) return |
if name.lower() != self.name.lower() and not self.substring: | if Unicode(name.lower()) != self.name.lower() and not self.substring: | def match(self, name, channel, start): """ Return True if name, channel and start match this favorite. """ if name.lower() != self.name.lower() and not self.substring: return False if name.lower().find(self.name.lower()) == -1: return False if not channel in self.channels: return False timestruct = time.localtime(start... |
ptsize = int(ptsize / 0.7) | def drawstringframed(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top'): | |
s = s.replace(' ',' ') | s = s.replace(' ',' ') s = re.sub(r'([ ]$)','',s) s = re.sub(r'(^[ ])','',s) if s == '': return | def drawstringframed(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top'): |
tmp_word_size , tmp_word_height = self.stringsize(lines[line_number][len(lines[line_number])-1], font,ptsize) lines[line_number][len(lines[line_number])-1] = '...' | if len(lines[line_number]) > 0: lines[line_number][len(lines[line_number])-1] = '...' else: lines[line_number].append('...') tmp_word_size , tmp_word_height = self.stringsize(lines[line_number][len(lines[line_number])-1], font,ptsize) | def drawstringframed(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top'): |
self.MAILBOX=os.environ['MAIL'] self.CLOCKFONT='skins/fonts/Trebuchet_MS.ttf' | if 'MAIL' in os.environ: self.MAILBOX = os.environ['MAIL'] else: self.MAILBOX = '' self.CLOCKFONT = 'skins/fonts/Trebuchet_MS.ttf' | def __init__(self): self.idlecount = 0 self.clock_surface = osd.getsurface(525, 25, 225, 50) self.mail_surface = osd.getsurface(25,25,225,50) self.MAILBOX='/var/mail/aubin' if not os.path.isfile(self.MAILBOX): # XXX Try the mail environment; this might not work if the user runs this # as root, if he starts with 'sudo'... |
DrawBox(conf_x, y0, conf_x+val.label.width, y1, val.label.bgcolor, 1, val.border_color) | osd.drawbox(conf_x, y0, conf_x+val.label.width, y1, width=-1, color=val.label.bgcolor) | def DrawTVGuide_Listing(self, to_listing, settings): val = settings.listing |
if (not self.display_type or self.display_type == 'audio' or \ self.display_type == 'image' or \ (self.MOVIE_PLAYLISTS and self.display_type == 'video')): self.playlist = play_items | self.playlist = play_items | def cwd(self, arg=None, menuw=None): """ make a menu item for each file in the directory """ # Problems with disc id: # [2114541066, 10, 150, 17220, 36170, 54412, 68800, 91162, 112110, 129230, 141320, 165100, 2392] # Returns multiple results print self.disc_id (query_stat, query_info) = CDDB.query(self.disc_id) if que... |
if ((not self.display_type or self.display_type == 'audio') and \ len(play_items) > 1 and self.display_type and config.AUDIO_RANDOM_PLAYLIST == 1): | if len(play_items) > 1 and config.AUDIO_RANDOM_PLAYLIST == 1: | def cwd(self, arg=None, menuw=None): """ make a menu item for each file in the directory """ # Problems with disc id: # [2114541066, 10, 150, 17220, 36170, 54412, 68800, 91162, 112110, 129230, 141320, 165100, 2392] # Returns multiple results print self.disc_id (query_stat, query_info) = CDDB.query(self.disc_id) if que... |
_debug_('Loading configure settings: %s' % freevoconf, 1) | _debug_('Loading configure settings: %s' % freevoconf) | def _debug_function_(s, level=1): if DEBUG < level: return # add the current trace to the string where = traceback.extract_stack(limit = 2)[0] s = '%s (%s): %s' % (where[0][where[0].rfind('/')+1:], where[1], s) # print debug message print s |
_debug_('Loading cfg: %s' % os.environ['FREEVO_CONFIG'], 1) | _debug_('Loading cfg: %s' % os.environ['FREEVO_CONFIG']) | def _debug_function_(s, level=1): if DEBUG < level: return # add the current trace to the string where = traceback.extract_stack(limit = 2)[0] s = '%s (%s): %s' % (where[0][where[0].rfind('/')+1:], where[1], s) # print debug message print s |
DIR_RECORD = '/tmp/' | DIR_RECORD = DIR_MOVIES[0][1] | def _debug_function_(s, level=1): if DEBUG < level: return # add the current trace to the string where = traceback.extract_stack(limit = 2)[0] s = '%s (%s): %s' % (where[0][where[0].rfind('/')+1:], where[1], s) # print debug message print s |
print 'remove the tv plugin. Autoset variable to /tmp.' | print 'remove the tv plugin. Autoset variable to %s.' % DIR_RECORD | def _debug_function_(s, level=1): if DEBUG < level: return # add the current trace to the string where = traceback.extract_stack(limit = 2)[0] s = '%s (%s): %s' % (where[0][where[0].rfind('/')+1:], where[1], s) # print debug message print s |
if TV_CHANNELS == None: | if TV_CHANNELS == None and plugin.is_active('tv'): | def detect_channels(): """ Auto detect a list of possible channels in the xmltv file """ import codecs import cPickle, pickle file = XMLTV_FILE path = FREEVO_CACHEDIR pfile = 'xmltv_channels.pickle' pname = os.path.join(path,pfile) if not os.path.isfile(file): if not HELPER: print print 'Error: can\'t find %s' % fil... |
movie.play(None, play_options) | movie.play_movie(None, play_options) | def autostart(): if config.ROM_DRIVES != None: media,label,image,play_options = util.identifymedia(config.ROM_DRIVES[0][0]) if play_options: movie.play(None, play_options) elif media == 'DIVX': movie.cwd(config.ROM_DRIVES[0][0], menuwidget) elif media == 'MP3': mp3.cwd(config.ROM_DRIVES[0][0], menuwidget) elif media ==... |
elif media == 'MP3': mp3.cwd(config.ROM_DRIVES[0][0], menuwidget) | elif media == 'AUDIO': music.parse_entry([config.ROM_DRIVES[0][0], config.ROM_DRIVES[0][0]], menuwidget) | def autostart(): if config.ROM_DRIVES != None: media,label,image,play_options = util.identifymedia(config.ROM_DRIVES[0][0]) if play_options: movie.play(None, play_options) elif media == 'DIVX': movie.cwd(config.ROM_DRIVES[0][0], menuwidget) elif media == 'MP3': mp3.cwd(config.ROM_DRIVES[0][0], menuwidget) elif media ==... |
self.x0, self.y0, self.x1, self.y1 = self.width, self.height, 0, 0 def load_scaled_image(self, filename, width, height): i = self.loadbitmap(filename) if not i: return None scale = max(float(i.get_width()) / width, float(i.get_height()) / height) return pygame.transform.scale(i, (int(i.get_width() / scale), int(i.get... | def __init__(self, width, height): self.width = width self.height = height self.depth = 32 self.screen = pygame.Surface((width, height), pygame.SRCALPHA) | |
def update(self, rect): | def update(self, rect=None): if not rect: if self.x0 > self.x1: return rect = self.x0, self.y0, self.x1 - self.x0, self.y1 - self.y0 self.x0, self.y0, self.x1, self.y1 = self.width, self.height, 0, 0 | def update(self, rect): update = self.screen.subsurface(rect) try: os.write(self.bmovl, 'RGBA32 %d %d %d %d %d %d\n' % \ (update.get_width(), update.get_height(), rect[0], rect[1], 0, 0)) os.write(self.bmovl, pygame.image.tostring(update, 'RGBA')) except OSError: pass |
self.start = 0 if self.player.item_info and hasattr(self.player.item_info, 'ts_start'): self.start = self.player.item_info.ts_start | self.start = 0 try: self.length = int(self.item.info['length']) except: self.lebgth = 0 if self.player.item_info: length = int(self.player.item_info.length) if hasattr(self.player.item_info, 'ts_start'): self.start = self.player.item_info.ts_start | def play(self, command, player): """ called before playing is started to add some stuff to the command line """ self.item = player.item self.player = player self.osd_visible = False self.bmovl = None |
self.bmovl.screen.blit(bg, (0,0)) self.clockfont = skin.get_singleton().get_font('clock') | self.clockfont = skin.get_singleton().get_font('bmovl timer') | def show_osd(self): """ bmovl: init bmovl osd and show it """ _debug_('show osd') |
self.bmovl.update((0, self.bmovl.height-self.height, self.bmovl.width, self.height)) | def show_osd(self): """ bmovl: init bmovl osd and show it """ _debug_('show osd') | |
i = self.bmovl.loadbitmap(os.path.join(config.IMAGE_DIR, 'gant/movie.png')) scale = max(float(i.get_width()) / 200, float(i.get_height()) / \ (self.height-config.OSD_OVERSCAN_Y-30)) image = pygame.transform.scale(i, (int(i.get_width() / scale), int(i.get_height() / scale))) self.bmovl.screen.blit(image, (self.x0, self.... | f = os.path.join(config.IMAGE_DIR, 'gant/movie.png') i = self.bmovl.load_scaled_image(f, 90, 90) if i: self.bmovl.screenblit(i, (self.x0 + self.width - i.get_width(), self.y0 + 30)) f = skin.get_singleton().settings.images['logo'] i = self.bmovl.load_scaled_image(f, 200, 90) if i: self.bmovl.screenblit(i, (self.x0, s... | def show_osd(self): """ bmovl: init bmovl osd and show it """ _debug_('show osd') |
font = skin.get_singleton().get_font('title') pos = self.bmovl.drawstringframed(title, self.x0 + 100, self.y0 + 40, self.width - 100, -1, font) self.bmovl.update((0, self.bmovl.height-self.height, self.bmovl.width, self.height)) self.elapsed(self.last_timer) | offset = 20 + i.get_width() font = skin.get_singleton().get_font('bmovl title') pos = self.bmovl.drawstringframed(title, self.x0 + offset, self.y0 + 40, self.width - offset, -1, font) font = skin.get_singleton().get_font('bmovl text') pos = self.bmovl.drawstringframed('%s min.' % (self.length / 60), self.x0 + offse... | def show_osd(self): """ bmovl: init bmovl osd and show it """ _debug_('show osd') |
def elapsed(self, timer): | def elapsed(self, timer, update=True): | def elapsed(self, timer): """ update osd """ if not self.bmovl: self.bmovl = OSDbmovl(self.width, self.height) if self.osd_visible: start = self.start end = self.start + int(self.item.info['length']) |
end = self.start + int(self.item.info['length']) | end = self.start + self.length | def elapsed(self, timer): """ update osd """ if not self.bmovl: self.bmovl = OSDbmovl(self.width, self.height) if self.osd_visible: start = self.start end = self.start + int(self.item.info['length']) |
self.bmovl.screen.blit(self.bg, (self.x0, self.y0)) | self.bmovl.screenblit(self.bg, (self.x0, self.y0)) | def elapsed(self, timer): """ update osd """ if not self.bmovl: self.bmovl = OSDbmovl(self.width, self.height) if self.osd_visible: start = self.start end = self.start + int(self.item.info['length']) |
self.bmovl.update((self.x0, self.y0, self.width, 30)) | if update: self.bmovl.update() font = skin.get_singleton().get_font('bmovl clock') | def elapsed(self, timer): """ update osd """ if not self.bmovl: self.bmovl = OSDbmovl(self.width, self.height) if self.osd_visible: start = self.start end = self.start + int(self.item.info['length']) |
self.cbg = pygame.Surface((self.bmovl.width - 110, 65)) | self.cbg = pygame.Surface((200, 30)) | def elapsed(self, timer): """ update osd """ if not self.bmovl: self.bmovl = OSDbmovl(self.width, self.height) if self.osd_visible: start = self.start end = self.start + int(self.item.info['length']) |
(self.x0 + self.width - 200, self.y0 + 65, 200, 30)) | (self.x0 + self.width - 200, self.y0 + 78, 200, 30)) | def elapsed(self, timer): """ update osd """ if not self.bmovl: self.bmovl = OSDbmovl(self.width, self.height) if self.osd_visible: start = self.start end = self.start + int(self.item.info['length']) |
self.bmovl.screen.blit(self.cbg, (self.x0 + self.width - 200, self.y0 + 65)) | self.bmovl.screenblit(self.cbg, (self.x0 + self.width - 200, self.y0 + 78)) | def elapsed(self, timer): """ update osd """ if not self.bmovl: self.bmovl = OSDbmovl(self.width, self.height) if self.osd_visible: start = self.start end = self.start + int(self.item.info['length']) |
self.x0 + self.width - 200, self.y0 + 68, | self.x0 + self.width - 200, self.y0 + 80, | def elapsed(self, timer): """ update osd """ if not self.bmovl: self.bmovl = OSDbmovl(self.width, self.height) if self.osd_visible: start = self.start end = self.start + int(self.item.info['length']) |
self.bmovl.update((self.x0 + self.width - 200, self.y0 + 65, 200, 30)) | if update: self.bmovl.update() | def elapsed(self, timer): """ update osd """ if not self.bmovl: self.bmovl = OSDbmovl(self.width, self.height) if self.osd_visible: start = self.start end = self.start + int(self.item.info['length']) |
shutil.copy(capture, vfs.getoverlay(imagefile[1:])) except: print 'unable to write file' | if not os.path.isdir(os.path.dirname(imagefile)): os.makedirs(os.path.dirname(imagefile)) shutil.copy(capture, imagefile) except Exception, e: print 'unable to write file %s: %s' % (vfs.getoverlay(imagefile), e) | def snapshot(videofile, imagefile=None, pos=None, update=True): """ make a snapshot of the videofile at position pos to imagefile """ global _runqueue if not imagefile: imagefile = vfs.getoverlay(videofile + '.raw') if not update and os.path.isfile(imagefile) and \ os.stat(videofile)[ST_MTIME] <= os.stat(imagefile)[ST... |
else: | elif menu.choices: | def GetDisplayStyle(self, menu=None): """ return current display style """ if menu: if menu.force_skin_layout != -1: return menu.force_skin_layout else: different = 0 last = menu.choices[ 0 ].image for i in menu.choices: if last != i.image: different = 1 break last = i.image if not different: if menu and menu.skin_set... |
fontsize = config.OSD_FONTSIZE_BTNS*ptscale | fontsize = config.OSD_FONTSIZE_BTNS | def refresh(self): self.osd.clearscreen(self.osd.COL_WHITE) |
if popup: popup.destroy() | def get_guide(popup=None, verbose=True, XMLTV_FILE=None): """ Get a TV guide from memory cache, file cache or raw XMLTV file. Tries to return at least the channels from the config file if there is no other data """ global cached_guide if not XMLTV_FILE: XMLTV_FILE = config.XMLTV_FILE # Can we use the cached version (... | |
eventhandler.register(self, PLAY_END) | def __init__(self, show_detachbar=True): """ init the idlebar """ IdleBarPlugin.__init__(self) config.EVENTS['audio']['DISPLAY'] = Event(FUNCTION_CALL, arg=self.detach) plugin.register(self, 'audio.detach') | |
eventhandler.register(self, DETACH_AUDIO_STOP) | def __init__(self, show_detachbar=True): """ init the idlebar """ IdleBarPlugin.__init__(self) config.EVENTS['audio']['DISPLAY'] = Event(FUNCTION_CALL, arg=self.detach) plugin.register(self, 'audio.detach') | |
return audioplayer().eventhandler(STOP) if not event.arg: return False if event == PLAY_END and event.arg == self.item: self.hide() | plugin.getbyname('idlebar').update() gui.get_display().update() return True | def eventhandler(self, event, menuw=None): """ Catches the play events """ |
return True | def eventhandler(self, event, menuw=None): """ Catches the play events """ | |
if self.display_type in p.display_type: self.suffixlist += p.suffix() self.get_plugins.append(p) | self.suffixlist += p.suffix() self.get_plugins.append(p) | def build(self): """ Build the playlist. Create a list of items and filenames. This function will load the playlist file or expand directories """ if self.suffixlist: # we called this function before return playlist = self.playlist self.playlist = [] for p in plugin.mimetype(self.display_type): if self.display_t... |
for i in playlist: if isinstance(i, Item): i = copy.copy(i) i.parent = self self.playlist.append(i) elif isinstance(i, list) or isinstance(i, tuple) and \ len(i) == 2 and vfs.isdir(i[0]): if i[1]: self.playlist += util.match_files_recursively(i[0], self.suffixlist) | if not isinstance(playlist, str): for i in playlist: if isinstance(i, Item): i = copy.copy(i) i.parent = self self.playlist.append(i) elif isinstance(i, list) or isinstance(i, tuple) and \ len(i) == 2 and vfs.isdir(i[0]): if i[1]: self.playlist += util.match_files_recursively(i[0], self.suffixlist) else: self.playli... | def build(self): """ Build the playlist. Create a list of items and filenames. This function will load the playlist file or expand directories """ if self.suffixlist: # we called this function before return playlist = self.playlist self.playlist = [] for p in plugin.mimetype(self.display_type): if self.display_t... |
self.playlist += util.match_files(i[0], self.suffixlist) self.autoplay = True else: self.playlist.append(i) | self.playlist.append(i) | def build(self): """ Build the playlist. Create a list of items and filenames. This function will load the playlist file or expand directories """ if self.suffixlist: # we called this function before return playlist = self.playlist self.playlist = [] for p in plugin.mimetype(self.display_type): if self.display_t... |
or ( item.parent.dir == self.from_dir))): | or ( item.parent.dir == self.from_dir) or ( item.parent.dir == self.from_dir + '/'))): | def actions(self, item): self.item = item if ( item.type == 'video' and item.mode == 'file' and item.parent.type == 'dir' # don't bother moving to current-dir and self.to_dir != os.path.dirname(self.item.filename) # recursive and ( ( self.recursive and os.path.commonprefix( ( item.parent.dir, self.from_dir)) == self.fr... |
log.error( 'Item is not an Audio CD' )) | log.error( 'Item is not an Audio CD' ) | def actions(self, item): self.item = item |
print 'unable to read directory' | print 'DirwatcherThread: unable to read directory %s' % self.dir | def scan(self): self.lock.acquire() |
infolist = xml_parser.parseMovieFile(file, os.path.dirname(file),[]) | infolist = xml_parser.parseMovieFile(file) | def info_showdata(self, arg=None, menuw=None): """ show info for this item """ |
[ '-a', artist, 'G', genre, '-N', track, '-t', song_names[i], | [ '-a', artist, '-G', genre, '-N', track, '-t', song_names[i], | def cd_backup_threaded(self, device, rip_format='mp3'): rip_format = rip_format album = 'default_album' artist = 'default_artist' genre = 'default_genre' dir_audio_default = "dir_audio_default" path_head = '' for media in config.REMOVABLE_MEDIA: if media.devicename == device: media.type = 'cdrip' |
for x in range((w-pixels), w): | for x in range(max(w-pixels, 1), w): | def __draw_transparent_text__(self, surface, pixels=30): """ Helper for drawing a transparency gradient end for strings which don't fit it's content area. """ #n = time.time() opaque_mod = float(1) opaque_stp = opaque_mod/float(pixels) w, h = surface.get_size() alpha = pygame.surfarray.pixels_alpha(surface) |
elif event == em.MENU_DOWN: self.event_DOWN() self.menuw.refresh() elif event == em.MENU_UP: self.event_UP() self.menuw.refresh() elif event == em.MENU_RIGHT: self.event_RIGHT() self.menuw.refresh() elif event == em.MENU_LEFT: self.event_LEFT() self.menuw.refresh() | def eventhandler(self, event): if hasattr(self, 'event_%s' % event): eval('self.event_%s()' % event) self.menuw.refresh() elif event == em.MENU_UP: self.event_UP() self.menuw.refresh() | |
_debug_('Main loop starting...') | _debug_('Main loop starting...',2) | def main_func(): import plugin if hasattr(skin, 'Splashscreen'): plugin.init(skin.Splashscreen().progress) else: plugin.init() signal.signal(signal.SIGTERM, signal_handler) signal.signal(signal.SIGINT, signal_handler) main = MainMenu() main.getcmd() poll_plugins = plugin.get('daemon_poll') eventhandler_plugins = [... |
if not rc.app(): | if rc.app(): | def check_cache_status(): """ check if cache got updated with helper while freevo is running """ global __last_status_check__ if not rc.app(): return try: cachefile = os.path.join(config.FREEVO_CACHEDIR, 'mediainfo') if os.stat(cachefile)[stat.ST_MTIME] <= __last_status_check__: return if not __last_status_check__: __l... |
type = ptl[p._type] for i in range(len(type)): if type[i]._level > p._level: type.insert(i, p) break else: type.append(p) | type = ptl[p._type].append(p) | def init(): """ load and init all the plugins """ global ptl global all_plugins global initialized global named_plugins initialized = TRUE for name, type, level, args, number in all_plugins: module = name[:name.rfind('.')] if os.path.isfile('src/plugins/%s.py' % module): module = 'plugins.%s' % module object = 'pl... |
if ptl.has_key('item') and mtype: if not ptl.has_key('item%s' % mtype): ptl['item%s' % mtype] = [] for p in ptl['item']: ptl['item%s' % mtype].append(p) sort_plugins() | def init(): """ load and init all the plugins """ global ptl global all_plugins global initialized global named_plugins initialized = TRUE for name, type, level, args, number in all_plugins: module = name[:name.rfind('.')] if os.path.isfile('src/plugins/%s.py' % module): module = 'plugins.%s' % module object = 'pl... | |
def setstd(self, value): tv.v4l2.Videodev.setstd(self, value) time.sleep(1) self.mspSetMatrix() | def setstd(self, value): tv.v4l2.Videodev.setstd(self, value) time.sleep(1) self.mspSetMatrix() | |
self.setinput(opts['input']) | def init_settings(self, opts=None): if not opts: opts = config.TV_IVTV_OPTIONS | |
return '%s-%s' % (String(self['trackno']), String(self.url)) | return '%0.3i-%s' % (int(self['trackno']), String(self.url)) | def sort(self, mode=None): """ Returns the string how to sort this item """ if mode == 'date': if self.filename: return '%s%s' % (os.stat(self.filename).st_ctime, self.filename) if mode == 'advanced': # sort by track number return '%s-%s' % (String(self['trackno']), String(self.url)) return self.url |
node.attrs[('',name)] = value | node.attr_list.append(((None, name), value)) | def setattr(self, node, name, value): """ sets the attribute of the node or if node is 'None', set user defined data for the fxd parser. """ if node: node.attrs[('',name)] = value else: self.user_data[name] = value |
if (event == rc.MENU or event == rc.STOP or event == rc.EXIT or event == rc.SELECT or event == rc.PLAY_END): | if event in (em.MENU_GOTO_MAINMENU, em.STOP, em.INPUT_EXIT, em.MENU_SELECT, em.PLAY_END): | def eventhandler(self, event): print '%s: %s app got %s event' % (time.time(), self.mode, event) if (event == rc.MENU or event == rc.STOP or event == rc.EXIT or event == rc.SELECT or event == rc.PLAY_END): self.Stop() rc.post_event(rc.PLAY_END) return TRUE elif event == rc.CHUP or event == rc.CHDOWN: if self.mode == '... |
rc.post_event(rc.PLAY_END) | rc.post_event(em.PLAY_END) | def eventhandler(self, event): print '%s: %s app got %s event' % (time.time(), self.mode, event) if (event == rc.MENU or event == rc.STOP or event == rc.EXIT or event == rc.SELECT or event == rc.PLAY_END): self.Stop() rc.post_event(rc.PLAY_END) return TRUE elif event == rc.CHUP or event == rc.CHDOWN: if self.mode == '... |
elif event == rc.CHUP or event == rc.CHDOWN: | elif event == em.MENU_PAGEUP or event == em.MENU_PAGEDOWN: | def eventhandler(self, event): print '%s: %s app got %s event' % (time.time(), self.mode, event) if (event == rc.MENU or event == rc.STOP or event == rc.EXIT or event == rc.SELECT or event == rc.PLAY_END): self.Stop() rc.post_event(rc.PLAY_END) return TRUE elif event == rc.CHUP or event == rc.CHDOWN: if self.mode == '... |
if event == rc.CHUP: | if event == em.MENU_PAGEUP: self.TunerNextChannel() else: | def eventhandler(self, event): print '%s: %s app got %s event' % (time.time(), self.mode, event) if (event == rc.MENU or event == rc.STOP or event == rc.EXIT or event == rc.SELECT or event == rc.PLAY_END): self.Stop() rc.post_event(rc.PLAY_END) return TRUE elif event == rc.CHUP or event == rc.CHDOWN: if self.mode == '... |
else: self.TunerNextChannel() | def eventhandler(self, event): print '%s: %s app got %s event' % (time.time(), self.mode, event) if (event == rc.MENU or event == rc.STOP or event == rc.EXIT or event == rc.SELECT or event == rc.PLAY_END): self.Stop() rc.post_event(rc.PLAY_END) return TRUE elif event == rc.CHUP or event == rc.CHDOWN: if self.mode == '... | |
self.thread.app.write('pause\n') | def eventhandler(self, event): print '%s: %s app got %s event' % (time.time(), self.mode, event) if (event == rc.MENU or event == rc.STOP or event == rc.EXIT or event == rc.SELECT or event == rc.PLAY_END): self.Stop() rc.post_event(rc.PLAY_END) return TRUE elif event == rc.CHUP or event == rc.CHDOWN: if self.mode == '... | |
self.thread.app.write('seek 0 0\n') self.thread.app.write('pause\n') | def eventhandler(self, event): print '%s: %s app got %s event' % (time.time(), self.mode, event) if (event == rc.MENU or event == rc.STOP or event == rc.EXIT or event == rc.SELECT or event == rc.PLAY_END): self.Stop() rc.post_event(rc.PLAY_END) return TRUE elif event == rc.CHUP or event == rc.CHDOWN: if self.mode == '... | |
elif event == rc.DISPLAY: | elif event == em.TOGGLE_OSD: | def eventhandler(self, event): print '%s: %s app got %s event' % (time.time(), self.mode, event) if (event == rc.MENU or event == rc.STOP or event == rc.EXIT or event == rc.SELECT or event == rc.PLAY_END): self.Stop() rc.post_event(rc.PLAY_END) return TRUE elif event == rc.CHUP or event == rc.CHDOWN: if self.mode == '... |
rc.post_event(rc.PLAY_END) | rc.post_event(em.PLAY_END) | def run(self): while 1: if self.mode == 'idle': self.mode_flag.wait() self.mode_flag.clear() elif self.mode == 'play': # The DXR3 device cannot be shared between our SDL session # and MPlayer. if (osd.sdl_driver == 'dxr3'): if DEBUG: print "Stopping Display for Video Playback on DXR3" osd.stopdisplay() if DEBUG: print... |
while len(self.menustack > 1): | while len(self.menustack) > 1: | def eventhandler(self, event): """ Eventhandler for menu control """ menu = self.menustack[-1] |
if fname == filename: | if stringproxy(fname) == stringproxy(filename): | def _getbitmap(self, filename): if not pygame.display.get_init(): return None |
if fname == filename: | if stringproxy(fname) == stringproxy(filename): | def _deletefromcache(self, filename): for i in range(len(self.bitmapcache)): fname, image = self.bitmapcache[i] if fname == filename: del self.bitmapcache[i] |
import mediainfo | def String(string, encoding=config.encoding): if type(string) == unicode: return string.encode(encoding, 'replace') return string | |
self.player.signals['failed'].connect_once(self._play_failed) | def play(self, item, player=None): """ play an item """ # FIXME: handle starting something when self.player.is_playing() # if self.player and self.player.is_playing(): # return | |
if 1: | if item.playlist: | def DrawMenu_Cover(self, menuw, settings): image_x = 0 val = settings menu = menuw.menustack[-1] artist,album,year,length = None, None, None, None |
if self._backing_store and hasattr(o, "_backing_store_info"): | if self._backing_store and hasattr(o, "_backing_store_info") and \ "pos" in o._backing_store_info: | def remove_child(self, o): if o not in self.children: return |
try: | if 'visible' in self.content and isinstance(self.visible, str): | def prepare(self, font_dict=None, color_dict=None): """ basic prepare function """ try: if self.visible not in ('', 'yes'): if len(self.visible) > 4 and self.visible[:4] == 'not ': p = plugin.getbyname(self.visible[4:]) else: p = plugin.getbyname(self.visible) if len(self.visible) > 4 and self.visible[:4] == 'not ': se... |
except (TypeError, AttributeError): pass if font_dict: try: | if 'font' in self.content and font_dict: if font_dict.has_key(self.font): | def prepare(self, font_dict=None, color_dict=None): """ basic prepare function """ try: if self.visible not in ('', 'yes'): if len(self.visible) > 4 and self.visible[:4] == 'not ': p = plugin.getbyname(self.visible[4:]) else: p = plugin.getbyname(self.visible) if len(self.visible) > 4 and self.visible[:4] == 'not ': se... |
except (TypeError, KeyError): | else: | def prepare(self, font_dict=None, color_dict=None): """ basic prepare function """ try: if self.visible not in ('', 'yes'): if len(self.visible) > 4 and self.visible[:4] == 'not ': p = plugin.getbyname(self.visible[4:]) else: p = plugin.getbyname(self.visible) if len(self.visible) > 4 and self.visible[:4] == 'not ': se... |
except AttributeError: pass if color_dict: try: | if 'color' in self.content: if color_dict and color_dict.has_key(self.color): | def prepare(self, font_dict=None, color_dict=None): """ basic prepare function """ try: if self.visible not in ('', 'yes'): if len(self.visible) > 4 and self.visible[:4] == 'not ': p = plugin.getbyname(self.visible[4:]) else: p = plugin.getbyname(self.visible) if len(self.visible) > 4 and self.visible[:4] == 'not ': se... |
except (TypeError, KeyError, AttributeError): pass try: | self.color = int2col(self.color) if 'bgcolor' in self.content: if color_dict and color_dict.has_key(self.bgcolor): | def prepare(self, font_dict=None, color_dict=None): """ basic prepare function """ try: if self.visible not in ('', 'yes'): if len(self.visible) > 4 and self.visible[:4] == 'not ': p = plugin.getbyname(self.visible[4:]) else: p = plugin.getbyname(self.visible) if len(self.visible) > 4 and self.visible[:4] == 'not ': se... |
except (TypeError, KeyError, AttributeError): pass try: self.color = int2col(self.color) except (TypeError, AttributeError): pass try: | def prepare(self, font_dict=None, color_dict=None): """ basic prepare function """ try: if self.visible not in ('', 'yes'): if len(self.visible) > 4 and self.visible[:4] == 'not ': p = plugin.getbyname(self.visible[4:]) else: p = plugin.getbyname(self.visible) if len(self.visible) > 4 and self.visible[:4] == 'not ': se... | |
except (TypeError, AttributeError): pass | def prepare(self, font_dict=None, color_dict=None): """ basic prepare function """ try: if self.visible not in ('', 'yes'): if len(self.visible) > 4 and self.visible[:4] == 'not ': p = plugin.getbyname(self.visible[4:]) else: p = plugin.getbyname(self.visible) if len(self.visible) > 4 and self.visible[:4] == 'not ': se... | |
pass | self.__color[node.attrs[('', 'label')]] = value | def parse(self, children, scale, c_dir): """ parse the skin root node """ for node in children: if node.name == u'main': self.__mainmenu.parse(node, scale, c_dir) |
plist_fname = config.FREEVO_CACHEDIR + '/freevo-autoplaylist.m3u' create_randomized_playlist(files, plist_fname) | playlist = config.FREEVO_CACHEDIR + '/freevo-autoplaylist.m3u' create_randomized_playlist(files, playlist) | def parse_entry( arg=None, menuw=None ): """ The music module change directory handling function formerly known as cwd Arguments: Array of arguments - Since that's the way it is done. Todo: Should do a test on dir to see if it is a playlist I open for it in main_menu, but it shouldn't be a problem. Got crash on p... |
items += [menu.MenuItem(title, make_playlist_menu, plist_fname)] | items += [menu.MenuItem(title, make_playlist_menu, playlist, handle_config, ('list', playlist))] | def parse_entry( arg=None, menuw=None ): """ The music module change directory handling function formerly known as cwd Arguments: Array of arguments - Since that's the way it is done. Todo: Should do a test on dir to see if it is a playlist I open for it in main_menu, but it shouldn't be a problem. Got crash on p... |
command = 'tvtime -k -I %s -n %s -d %s -f %s -c %s' % (w, | command = 'tvtime -D %s -k -I %s -n %s -d %s -f %s -c %s' % (config.CONF.display, w, | def Play(self, mode, tuner_channel=None, channel_change=0): |
mixer.setPcmVolume(0) mixer.setLineinVolume(0) mixer.setMicVolume(0) | if config.MAJOR_AUDIO_CTRL == 'VOL': mixer.setPcmVolume( 0 ) elif config.MAJOR_AUDIO_CTRL == 'PCM': mixer.setMainVolume( 0 ) if config.CONTROL_ALL_AUDIO: mixer.setLineinVolume( 0 ) mixer.setIgainVolume( 0 ) mixer.setMicVolume( 0 ) | def Play(self, mode, tuner_channel=None): |
mixer.setMicVolume(90) | mixer.setMicVolume( config.VCR_IN_VOLUME ) | def Play(self, mode, tuner_channel=None): |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.