rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
def delete_menu(self, arg=None, menuw=None): | def delete_menu(self, arg=None, menuw=None, allow_reload=True): | def delete_menu(self, arg=None, menuw=None): if len(self.menustack) > 1: self.menustack = self.menustack[:-1] menu = self.menustack[-1] |
if menu.reload_func: | if menu.reload_func and allow_reload: | def delete_menu(self, arg=None, menuw=None): if len(self.menustack) > 1: self.menustack = self.menustack[:-1] menu = self.menustack[-1] |
if self.eventhandler_plugins == None: self.eventhandler_plugins = plugin.get('daemon_eventhandler') | def eventhandler(self, event): menu = self.menustack[-1] | |
self.theme = None | sref = weakref(self) for c in choices: c.menu = sref self.theme = None | def __init__(self, heading, choices=[], theme=None, reload_func = None, item_types = None, force_skin_layout = -1): |
self.item = None | self.autoselect = False | def __init__(self, heading, choices=[], theme=None, reload_func = None, item_types = None, force_skin_layout = -1): |
mod = strftime(config.TV_TIMEFORMAT, gmtime(fav.mod * 60)) | mod = strftime(config.TV_TIMEFORMAT, gmtime(float(fav.mod * 60))) | def refreshList(self): (self.result, favorites) = record_client.getFavorites() if not self.result: errormsg = Label(_('Get favorites failed: %s') % recordings, self, Align.CENTER) return |
lines_size[line_number] -= MINIMUM_SPACE_BETWEEN_WORDS * \ (len(lines[line_number]) -1 ) | def drawstringframedsoft(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top', layer=None, ellipses='...'): | |
x0 += spacing x0 += word_size | x0 += spacing + word_size | def drawstringframedsoft(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top', layer=None, ellipses='...'): |
if word: | if lines[line_number][word_number]: | def drawstringframedsoft(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top', layer=None, ellipses='...'): |
if align_h == 'left': x0 = x elif align_h == 'center' or align_h == 'justified': | x0 = x if align_h == 'center' or align_h == 'justified': | 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='...'): |
self.destroy() | def stop(self, channel_change=0): """ Stop xine """ if self.app: self.app.stop('quit\n') self.destroy() | |
fd = open(LOG_FILE, 'a') fd.write(s + '\n') fd.close() | if config.DEBUG: fd = open(LOG_FILE, 'a') fd.write(s + '\n') fd.close() | def log(s=''): fd = open(LOG_FILE, 'a') fd.write(s + '\n') fd.close() |
if search_title or se: clause += ' or' | if search_title or search_subtitle: clause += ' or' | def search(self, searchstr, by_chan=None, search_title=True, search_subtitle=True, search_description=True, exact_match=False): """ Return a list of programs with a title similar to the given parameter. If by_chan is given, it has to be a valid channel id and only programs from this channel will be returned. Result is ... |
self.icecast-pid = None self.ices-pid = None | self.icecast_pid = None self.ices_pid = None | def __init__(self): plugin.DaemonPlugin.__init__(self) self.icecast-pid = None self.ices-pid = None |
self.icecast-pid = os.spawnl(os.P_NOWAIT, config.ICECAST_CMD, mycmd, '-d', config.ICECAST_CONF_DIR) | self.icecast_pid = os.spawnl(os.P_NOWAIT, config.ICECAST_CMD, mycmd, '-d', config.ICECAST_CONF_DIR) | def __init__(self): plugin.DaemonPlugin.__init__(self) self.icecast-pid = None self.ices-pid = None |
self.ices-pid = os.spawnv(os.P_NOWAIT, config.ICES_CMD, args) | self.ices_pid = os.spawnv(os.P_NOWAIT, config.ICES_CMD, args) | def __init__(self): plugin.DaemonPlugin.__init__(self) self.icecast-pid = None self.ices-pid = None |
os.kill(self.pid, signal.SIGTERM) os.waitpid(self.pid, 0) | os.kill(self.ices_pid, signal.SIGTERM) os.waitpid(self.ices_pid, 0) | def poll(self): #see if we got a change list request if (os.path.isfile(os.path.join(config.FREEVO_CACHEDIR, 'changem3u.txt'))): try: mycmd = os.path.basename(config.ICES_CMD) newm3ufile = file(os.path.join(config.FREEVO_CACHEDIR, 'changem3u.txt'), 'rb').read() os.unlink(os.path.join(config.FREEVO_CACHEDIR, 'changem3u.... |
media.info = (mediatype[0], 'Drive %s [%s %s]' % (media.drivename, mediatype[0], label), image, (mediatype[2], media.mountdir, [])) | media.info = (mediatype[0], title, image, (mediatype[2], media.mountdir, [])) | def identify(self, media): |
info = "DIVX", 'CD [%s]' % label, None, None | info = "DIVX", label, None, None | def identify(self, media): |
info = "AUDIO" , 'CD [%s]' % label, None, None | info = "AUDIO" , '%s [%s]' % (media.drivename, label), None, None | def identify(self, media): |
info = "IMAGE", 'CD [%s]' % label, None, None | info = "IMAGE", '%s [%s]' % (media.drivename, label), None, None | def identify(self, media): |
info = "DATA", 'CD [%s]' % label, None, None | info = "DATA", '%s [%s]' % (media.drivename, label), None, None | def identify(self, media): |
if re_label.match(label) and movie_info_t.name: | if re_label.match(label): | def identify(self, media): |
title = movie_info.name m = re_label.match(label).groups() re_count = 1 for g in m: title=string.replace(title, '\\%s' % re_count, g) re_count += 1 break | if movie_info_t.name: title = movie_info.name m = re_label.match(label).groups() re_count = 1 for g in m: title=string.replace(title, '\\%s' % re_count, g) re_count += 1 break | def identify(self, media): |
NORMS = { 'NTSC' : 0, 'PAL' : 1, 'SECAM' : 2 } | NORMS = { 'NTSC' : 0x3000, 'PAL' : 0xff, 'SECAM' : 0x7f0000 } | def _IOC_SIZE(nr): return (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) |
self.setinput(NORMS.get(v_norm)) | self.setstd(NORMS.get(v_norm)) | def init_settings(self): (v_norm, v_input, v_clist, v_dev) = config.TV_SETTINGS.split() v_norm = string.upper(v_norm) self.setinput(NORMS.get(v_norm)) |
mmpython.mediainfo.DEBUG = 0 mmpython.factory.DEBUG = 0 | mmpython.mediainfo.DEBUG = DEBUG mmpython.factory.DEBUG = DEBUG | def tracefunc(frame, event, arg, _indent=[0]): if event == 'call': filename = frame.f_code.co_filename funcname = frame.f_code.co_name lineno = frame.f_code.co_firstlineno if 'self' in frame.f_locals: try: classinst = frame.f_locals['self'] classname = repr(classinst).split()[0].split('(')[0][1:] funcname = '%s.%s' % (... |
elif not self.store_info(key, value): _debug_('unable to store info for \'%s\'' % self.name, 0) | else: self.store_info(key, value) | def __setitem__(self, key, value): """ set the value of 'key' to 'val' """ for var, val in self.autovars: if key == var: if val == value: if not self.delete_info(key): _debug_('unable to store info for \'%s\'' % self.name, 0) elif not self.store_info(key, value): _debug_('unable to store info for \'%s\'' % self.name, 0... |
self.info.delete(key) | return self.info.delete(key) | def delete_info(self, key): """ delete entry for metadata """ if isinstance(self.info, util.mediainfo.Info): self.info.delete(key) else: print 'unable to delete info for that kind of item' |
plugin.init(exclusive = [ 'record' ]) | def __init__(self): RPCServer.__init__(self, 'recordserver') config.detect('tvcards', 'channels') plugin.init(exclusive = [ 'record' ]) # file to load / save the recordings and favorites self.fxdfile = sysconfig.datafile('recordserver.fxd') # get list of best recorder for each channel self.best_recorder = {} for p in r... | |
self.load(True) | self.mbus_instance.register_entity_notification(self.__entity_update) self.check_favorites() def send_update(self): try: ret = [] for r in self.recordings: ret.append(r.short_list()) for c in self.clients: print 'send update', c self.mbus_instance.send_event(c, 'record.list.update', ret) except: log.exception('send... | def __init__(self): RPCServer.__init__(self, 'recordserver') config.detect('tvcards', 'channels') plugin.init(exclusive = [ 'record' ]) # file to load / save the recordings and favorites self.fxdfile = sysconfig.datafile('recordserver.fxd') # get list of best recorder for each channel self.best_recorder = {} for p in r... |
log.info('next ids: record=%s favorite=%s' % (self.rec_id, self.fav_id)) | log.info('next ids: record=%s favorite=%s' % \ (self.rec_id, self.fav_id)) | def __check_recordings(self): """ Check the current recordings. This includes checking conflicts, removing old entries. At the end, the timer is set for the next recording. """ notifier.removeTimer(self.check_timer) self.check_timer = None |
self.check_favorites() | def load(self, rebuild=False): """ load the fxd file """ self.rec_id = 0 self.fav_id = 0 self.recordings = [] self.favorites = [] try: fxd = util.fxdparser.FXD(self.fxdfile) fxd.set_handler('recording', self.__load_recording) fxd.set_handler('favorite', self.__load_favorite) fxd.parse() except Exception, e: log.excepti... | |
if os.path.isfile(self.fxdfile): os.unlink(self.fxdfile) fxd = util.fxdparser.FXD(self.fxdfile) for r in self.recordings: fxd.add(r) for r in self.favorites: fxd.add(r) fxd.save() | if not len(self.recordings) and not len(self.favorites): log.info('do not save fxd file') return try: log.info('save fxd file') if os.path.isfile(self.fxdfile): os.unlink(self.fxdfile) fxd = util.fxdparser.FXD(self.fxdfile) for r in self.recordings: fxd.add(r) for r in self.favorites: fxd.add(r) fxd.save() except: log... | def save(self): """ save the fxd file """ if os.path.isfile(self.fxdfile): os.unlink(self.fxdfile) fxd = util.fxdparser.FXD(self.fxdfile) for r in self.recordings: fxd.add(r) for r in self.favorites: fxd.add(r) fxd.save() |
result = unicode(str, 'unicode-escape') | try: result = unicode(str, 'unicode-escape') except: pass | def stringproxy(str): result = str if type(str) == StringType: result = unicode(str, 'unicode-escape') return result |
def printContentType(type="text/html", fp=sys.stdout): | def printContentType(content_type="text/html", fp=None): if not fp: fp = sys.stdout | def printContentType(type="text/html", fp=sys.stdout): if cgiIsCaller(): fp.write('Content-type:'+type+'\n\n\n') |
fp.write('Content-type:'+type+'\n\n\n') | fp.write('Content-type: %s\n\n' % content_type) | def printContentType(type="text/html", fp=sys.stdout): if cgiIsCaller(): fp.write('Content-type:'+type+'\n\n\n') |
def printHeader(title="unknown page", style=None, script=None, fp=sys.stdout): | def printHeader(title="unknown page", style=None, script=None, fp=None): if not fp: fp = sys.stdout | def printHeader(title="unknown page", style=None, script=None, fp=sys.stdout): fp.write('<html><head>\n') fp.write('<title>'+title+'</title>\n') if style != None: # fp.write('<style ContentType="text/css" src="'+style+'"></style>\n') fp.write('<link rel="stylesheet" href="styles/main.css" type="text/css" />\n') if scri... |
def tableOpen(opts="", fp=sys.stdout): | def tableOpen(opts="", fp=None): if not fp: fp = sys.stdout | def tableOpen(opts="", fp=sys.stdout): fp.write("<table "+opts+">\n") |
def tableClose(fp=sys.stdout): | def tableClose(fp=None): if not fp: fp = sys.stdout | def tableClose(fp=sys.stdout): fp.write("</table>\n") |
def tableRowOpen(opts="", fp=sys.stdout): | def tableRowOpen(opts="", fp=None): if not fp: fp = sys.stdout | def tableRowOpen(opts="", fp=sys.stdout): fp.write(" <tr "+opts+">\n") |
def tableRowClose(fp=sys.stdout): | def tableRowClose(fp=None): if not fp: fp = sys.stdout | def tableRowClose(fp=sys.stdout): fp.write(" </tr>\n") |
def tableCell(data="", opts="", fp=sys.stdout): | def tableCell(data="", opts="", fp=None): if not fp: fp = sys.stdout | def tableCell(data="", opts="", fp=sys.stdout): fp.write(" <td "+opts+">"+data+"</td>\n") |
def printFooter(fp=sys.stdout): | def printFooter(fp=None): if not fp: fp = sys.stdout | def printFooter(fp=sys.stdout): fp.write('<hr>\n') fp.write("</body></html>\n") |
def printSearchForm(fp=sys.stdout): | def printSearchForm(fp=None): if not fp: fp = sys.stdout | def printSearchForm(fp=sys.stdout): fp.write(""" |
def printLinks(fp=sys.stdout): | def printLinks(fp=None): if not fp: fp = sys.stdout | def printLinks(fp=sys.stdout): fp.write(""" |
print event | def eventhandler(self, event, menuw=None): """ Eventhandler for the media main menu. The menu must be regenerated when a disc in a rom drive changes """ if plugin.isevent(event): print event if not self.item_menu.visible: return True | |
if prg.title == _('This channel has no data loaded'): | if prg.title == Unicode(_('This channel has no data loaded')): | def update_content(self): """ update the listing area """ |
self.RE_TIME = re.compile("^A: +([0-9]+)").match | self.RE_TIME = re.compile("^A: *([0-9]+)").match | def __init__(self, app, item): if config.MPLAYER_DEBUG: startdir = os.environ['FREEVO_STARTDIR'] fname_out = os.path.join(startdir, 'mplayer_stdout.log') fname_err = os.path.join(startdir, 'mplayer_stderr.log') try: self.log_stdout = open(fname_out, 'a') self.log_stderr = open(fname_err, 'a') except IOError: print prin... |
tmp_pieces = re.sub(r'(?P<str>[aeiou!@ | tmp_pieces = re.sub(r'(?P<str>[aeiouAEIOU!@ | def drawstringframed(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top'): |
tmp_pieces = tmp_pieces.split(' ') | def drawstringframed(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top'): | |
word_size, word_height = self.stringsize(word, font,ptsize) self.drawstring(word, x0, y0, fgcolor, None, font, ptsize) x0 += spacing x0 += word_size | if word: word_size, word_height = self.stringsize(word, font,ptsize) self.drawstring(word, x0, y0, fgcolor, None, font, ptsize) x0 += spacing x0 += word_size | def drawstringframed(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top'): |
pos = line_len - word_number -1 word_size, word_height = self.stringsize(lines[line_number][pos], font,ptsize) self.drawstring(lines[line_number][pos], x0, y0, fgcolor, None, font, ptsize, 'right') x0 -= spacing x0 -= word_size | if word: pos = line_len - word_number -1 word_size, word_height = self.stringsize(lines[line_number][pos], font,ptsize) self.drawstring(lines[line_number][pos], x0, y0, fgcolor, None, font, ptsize, 'right') x0 -= spacing x0 -= word_size | def drawstringframed(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top'): |
self.socket = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) | try: self.socket = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) except: self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | def __init__ (self, ip, port, handler, scripts, htdocs): self.handler = handler self.htdocs = htdocs self.scripts = scripts self.resources = {} self.socket = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) self.socket.setblocking(0) |
self.scheduled_programs.append(l[k]) | self.scheduled_programs.append(l[k].encode()) | def update_schedules(self, force=False): if not force and self.last_update + 60 > time.time(): return |
continue | prog.stop = timestr2secs_utc(p['start'][0:8] + '235900' + p['start'][14:18]) | def load_guide(): # Create a new guide guide = epg_types.TvGuide() # Is there a file to read from? if os.path.isfile(config.XMLTV_FILE): gotfile = 1 if 0: # XXX Hack to fix a bug where qp_xml barfs on 8-bit chars. # Read the current file print 'XMLTV: XXX Hack to fix a bug where qp_xml barfs on 8-bit chars.' fd = op... |
osd.drawstringframedsoft('%s\n%s\n%s\n%i:%i' % (art,alb,year,int(length/60),int(length%60)), 50,315, | osd.drawstringframedsoft('%s\n%s\n%s\n%0.2i:%0.2i' % (art,alb,year,int(length/60),int(length%60)), 50,315, | def DrawMenu(self, menuw): if self.hold: print 'skin.drawmenu() hold!' return # XXX Is this necessary? We're re-initializing the screen later. #osd.clearscreen(osd.COL_BLACK) |
print 'XXX' print self.media print self.url print self.filename | def play(self, arg=None, menuw=None): """ play the item. """ if not self.possible_player: for p in plugin.getbyname(plugin.VIDEO_PLAYER, True): rating = p.rate(self) * 10 if config.VIDEO_PREFERED_PLAYER == p.name: rating += 1 if hasattr(self, 'force_player') and p.name == self.force_player: rating += 100 self.possible_... | |
print self.media | def play(self, arg=None, menuw=None): """ play the item. """ if not self.possible_player: for p in plugin.getbyname(plugin.VIDEO_PLAYER, True): rating = p.rate(self) * 10 if config.VIDEO_PREFERED_PLAYER == p.name: rating += 1 if hasattr(self, 'force_player') and p.name == self.force_player: rating += 100 self.possible_... | |
_debug_('flac_command: %s' % (flac_command)) | _debug_('flac_command: %s' % (config.FLAC_CMD)) | 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' |
free = 0 f = open('/proc/meminfo') if f: | free = 0 meminfo = None try: f = file('/proc/meminfo', 'r') | def getMemUsage(self): """ May not be correct, but i like to see total free mem as freemem+cached """ free = 0 f = open('/proc/meminfo') |
free = int(string.split(string.split(meminfo,'\n')[1])[3]) f.close() self.currentMem = _('%iM') % (((free)/1024)/1024) | f.close() except OSError: _debug_('[procstats]: The file /proc/meminfo is not available') if meminfo: i = 0 meminfo = meminfo.split() for l in meminfo: if l in ['MemFree:', 'Buffers:', 'Cached:']: free += int(meminfo[i+1]) i += 1 self.currentMem = _('%iM') % (free/1024) | def getMemUsage(self): """ May not be correct, but i like to see total free mem as freemem+cached """ free = 0 f = open('/proc/meminfo') |
self.getStats() | def draw(self, (type, object), x, osd): font = osd.get_font('small0') self.getStats() widthmem = 0 widthcpu = 0 | |
if item.icon != None: item_icon_size_x, item_icon_size_y = osd.bitmapsize(item.icon) | def ItemsPerMenuPage(self, menu): | |
icon_size = 0 | def DrawMenu_Selection(self, menuw, settings, x0, y0, width, height): val = settings menu = menuw.menustack[-1] | |
osd.drawbitmap(icon) | def DrawMenu_Selection(self, menuw, settings, x0, y0, width, height): val = settings menu = menuw.menustack[-1] | |
if icon_present==1: icon_x = x0 icon_y = y0 - (icon_size - font_h) / 2 osd.drawbitmap(util.resize(icon, icon_size, icon_size), icon_x, icon_y) | def DrawMenu_Selection(self, menuw, settings, x0, y0, width, height): val = settings menu = menuw.menustack[-1] | |
osd.clearscreen(osd.COL_BLACK) | def DrawMenu(self, menuw): if self.hold: print 'skin.drawmenu() hold!' return osd.clearscreen(osd.COL_BLACK) | |
if image_val: InitScreen(val, (val.background.mask, image_val.mask), image_x) | if not menu.surface: if image_val: InitScreen(val, (val.background.mask, image_val.mask), image_x) else: InitScreen(val, (val.background.mask, None), image_x) menu.surface = osd.getsurface(0,76,768,500) | def DrawMenu(self, menuw): if self.hold: print 'skin.drawmenu() hold!' return osd.clearscreen(osd.COL_BLACK) |
InitScreen(val, (val.background.mask, None), image_x) | osd.putsurface(menu.surface,0,76) | def DrawMenu(self, menuw): if self.hold: print 'skin.drawmenu() hold!' return osd.clearscreen(osd.COL_BLACK) |
if image_x and val.items.x + val.items.width > image_x and \ val.items.x < image_x: selection_length = image_x - val.items.x | def DrawMenu(self, menuw): if self.hold: print 'skin.drawmenu() hold!' return osd.clearscreen(osd.COL_BLACK) | |
except: | except ValueError: | def format_track (self, array): """ Return a formatted string for use in music.py """ |
return None | pass | def __setitem__(self, key, object): if isinstance(key, str): key = unicode(key, config.LOCALE) |
img.crop(pos, size) | img = imagelib.crop(img, pos, size) | def _blit(self, img, r): pos, size = r t0=time.time() |
self.chanSet(self.getNextChannel(), app, app_cmd) | return self.chanSet(self.getNextChannel(), app, app_cmd) | def chanUp(self, app=None, app_cmd=None): """ Using this method will not support custom frequencies. """ self.chanSet(self.getNextChannel(), app, app_cmd) |
self.setChannel(self.getPrevChannel(), app, app_cmd) | return self.chanSet(self.getPrevChannel(), app, app_cmd) | def chanDown(self, app=None, app_cmd=None): """ Using this method will not support custom frequencies. """ self.setChannel(self.getPrevChannel(), app, app_cmd) |
return (self.chan_index-1) % len(config.TV_CHANNELS) | return config.TV_CHANNELS[(self.chan_index-1) % len(config.TV_CHANNELS)][2] | def getPrevChannel(self): return (self.chan_index-1) % len(config.TV_CHANNELS) |
self.autovars = { 'rotation': 0 } | def __init__(self, url, parent, duration = config.IMAGEVIEWER_DURATION): # set autovars to 'rotation' so that this value is # stored between Freevo sessions self.autovars = { 'rotation': 0 } MediaItem.__init__(self, parent, type='image') # set url and parse the name self.set_url(url, search_cover=False) self.duration =... | |
return the specific attribute as string or an empty string | Return the specific attribute as string or an empty string | def __getitem__(self, key): """ return the specific attribute as string or an empty string """ if key == "geometry": if self['width'] and self['height']: return '%sx%s' % (self['width'], self['height']) return '' |
if key == "geometry": | if key == 'geometry': | def __getitem__(self, key): """ return the specific attribute as string or an empty string """ if key == "geometry": if self['width'] and self['height']: return '%sx%s' % (self['width'], self['height']) return '' |
if key == "date": | if key == 'date': | def __getitem__(self, key): """ return the specific attribute as string or an empty string """ if key == "geometry": if self['width'] and self['height']: return '%sx%s' % (self['width'], self['height']) return '' |
def sort(self, mode=None): """ Returns the string how to sort this item """ if mode == 'date': return u'%s%s' % (os.stat(self.filename).st_ctime, Unicode(self.filename)) return Unicode(self.name) | def sort(self, mode=None): """ Returns the string how to sort this item """ if mode == 'date': return u'%s%s' % (os.stat(self.filename).st_ctime, Unicode(self.filename)) return Unicode(self.name) | |
return a list of possible actions on this item. | Return a list of possible actions on this item. | def actions(self): """ return a list of possible actions on this item. """ return [ Action(_('View Image'), self.play) ] |
caches (loads) the next image | Caches (loads) the next image | def cache(self): """ caches (loads) the next image """ imageviewer().cache(self) |
imageviewer().cache(self) | viewer.cache(self) | def cache(self): """ caches (loads) the next image """ imageviewer().cache(self) |
view the image | View the image | def play(self): """ view the image """ imageviewer().view(self, rotation=self['rotation']) |
imageviewer().view(self, rotation=self['rotation']) | viewer.view(self, rotation=self['rotation']) | def play(self): """ view the image """ imageviewer().view(self, rotation=self['rotation']) |
def hide(self, clear=True): | def hide(self): | def hide(self, clear=True): """ Hide the menu """ Application.hide(self) MenuStack.hide(self) if self.inside_menu: self.engine.hide(0) self.inside_menu = False else: self.engine.hide(config.GUI_FADE_STEPS) |
type = item.info.mime.replace('/', '_') | type = item.info['mime'].replace('/', '_') | def format_image(settings, item, width, height, shadow=None, force=0): try: type = item.display_type except: try: type = item.info.mime.replace('/', '_') except: type = item.type cname = '%s-%s-%s-%s-%s-%s-%s-%s' % (settings.icon_dir, item.image, type, item.type, width, height, shadow, force) if item.media and item.me... |
Item.__init__(self, parent, info=scan) | Item.__init__(self, parent) | def __init__(self, url, parent, name=None, scan=True): Item.__init__(self, parent, info=scan) |
if not isinstance(table_text[i], str): | if not (isinstance(table_text[i], str) or isinstance(table_text[i], unicode)): | def update_content(self): """ update the listing area """ |
mitem.parent = parent | def parseMovieFile(file, parent, duplicate_check): # Returns: # a list of VideoItems, # each VideoItem possibly contains a list of VideoItems # dir = os.path.dirname(file) # find the realdir in case this file is in MOVIE_DATA_DIR if dir.find(config.MOVIE_DATA_DIR) == 0: realdir = os.path.join('/', dir[len(config... | |
generic.PluginInterface.__init__(self) | def __init__(self, device='dvb0'): self.name = device self.device = config.TV_SETTINGS[device] generic.PluginInterface.__init__(self) | |
self.suffix = '.ts' | home = os.environ[ 'HOME' ] pathes = [ os.path.join( home, '.freevo' ), os.path.join( home, '.mplayer' ), os.path.join( home, '.xine' ) ] self.program = 'mplayer' | def __init__(self, device='dvb0'): self.name = device self.device = config.TV_SETTINGS[device] generic.PluginInterface.__init__(self) |
return [ config.CONF.mplayer, '-dumpstream', '-dumpfile', filename, 'dvb://' + String(channel) ] | if self.program == 'mplayer': return [ self.program_file, '-dumpstream', '-dumpfile', filename, 'dvb://' + String(channel) ] elif self.program == 'tzap': return [ self.program_file, '-o', filename, '-c', self.configfile, '-a', self.device.adapter, String( channel ) ] | def get_cmd(self, rec): channel = self.device.channels[rec.channel] if rec.url.startswith('file:'): filename = rec.url[5:] else: filename = rec.url return [ config.CONF.mplayer, '-dumpstream', '-dumpfile', filename, 'dvb://' + String(channel) ] |
filename = item.file | filename = item.filename | def view(self, item, zoom=0, rotation=0): filename = item.file |
osd.bitmapsize(fileitem.file) | osd.bitmapsize(fileitem.filename) | def cache(self, fileitem): # cache the next image (most likely we need this) osd.bitmapsize(fileitem.file) |
def eventhandler(self, event, menuw): | def eventhandler(self, event, menuw=None): | def eventhandler(self, event, menuw): """ catch the IDENTIFY_MEDIA event to redraw the skin (maybe the cd status plugin wants to redraw) """ if plugin.isevent(event) == 'IDENTIFY_MEDIA': skin.get_singleton().redraw() return FALSE |
for chan in get_channels().get_all(): if chan.id == channel_id: return chan.name | def get_chan_displayname(channel_id): for vals in config.TV_CHANNELS: tv_channel_id, tv_display_name, tv_tuner_id = vals[:3] if tv_channel_id == channel_id: return tv_display_name | |
guide = get_guide() | def when_listings_expire(): guide = get_guide() last = 0 left = 0 for ch in guide.chan_list: for prog in ch.programs: if prog.start > last: last = prog.start if last > 0: now = time.time() if last > now: left = int(last - now) # convert to hours left /= 3600 return left |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.