rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
if rect: | if rect and not (stop_busyicon and self.busyicon.rect): | def update(self, rect=None, blend_surface=None, blend_speed=0, blend_steps=0, blend_time=None, stop_busyicon=True): """ update the screen """ if not pygame.display.get_init(): return None |
_debug_('osd.update(rect) failed, bad rect? - %s' % rect, 1) | _debug_('osd.update(rect) failed, bad rect? - %s' % str(rect), 1) | def update(self, rect=None, blend_surface=None, blend_speed=0, blend_steps=0, blend_time=None, stop_busyicon=True): """ update the screen """ if not pygame.display.get_init(): return None |
if stop_busyicon: self.busyicon.rect = None | def update(self, rect=None, blend_surface=None, blend_speed=0, blend_steps=0, blend_time=None, stop_busyicon=True): """ update the screen """ if not pygame.display.get_init(): return None | |
self.sub_title = prog.sub_title self.desc = prog.desc | if hasattr(prog,'sub_title'): self.sub_title = prog.sub_title if hasattr(prog,'desc'): self.desc = prog.desc | def __init__(self, parent, prog, context='guide'): Item.__init__(self, parent, skin_type='video') self.prog = prog self.context = context |
for rat in prog.ratings.keys(): self.ratings += '%s ' % rat | try: for rat in prog.ratings.keys(): self.ratings += '%s ' % rat except: pass | def __init__(self, parent, prog, context='guide'): Item.__init__(self, parent, skin_type='video') self.prog = prog self.context = context |
print 'Couldnt open mixer %s!' % config.DEV_MIXER | print 'Couldn\'t open mixer %s' % config.DEV_MIXER | def __init__(self): try: self.mixfd = open(config.DEV_MIXER, 'r') except IOError: print 'Couldnt open mixer %s!' % config.DEV_MIXER self.mixfd = None return self.mainVolume = 0 self.pcmVolume = 0 self.lineinVolume = 0 self.micVolume = 0 self.igainVolume = 0 # XXX Used on SB Live self.ogainVolume = 0 #... |
notifier.removeTimer() | notifier.removeTimer(_callbacks[name]) | def __init__(self, timer, name, function, *args, **kwargs): self.name = name self.function = function self.args = args self.kwargs = kwargs |
j = 1 | j = 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='...'): |
(occupied_size + self.stringsize(ellipses, font, ptsize)[0]) \ > width: ellipses = ellipses[:-1] | (occupied_size + \ self.stringsize(ellipses, font, ptsize)[0]) > width: ellipses = ellipses[:-1] | 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='...'): |
rest_words = string[i:len(string)] | rest_words = string[i+1:len(string)] | 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 len(menu.choices) < 5: | if len(menu.choices) < 6: | def scan_for_text_view(self, menu): """ scan if we have to fall back to text view. This will be done if some items have images and all images are the same. And the number of items must be greater 5. With that the skin will fall back to text view for e.g. mp3s inside a folder with cover file """ try: self.use_text_view ... |
print mpl | def play(self, mode, filename, playlist, repeat=0, mplayer_options=""): | |
print command | def play(self, mode, filename, playlist, repeat=0, mplayer_options=""): | |
menu = menuw.menustack[1] | menu = menuw.menustack[-1] | def reload(self): menuw = self.menuw |
filename = url | def _getbitmap(self, url): """ load the bitmap or thumbnail """ if not pygame.display.get_init(): return None | |
data = re.search( "^tvtime: Running tvtime (?P<major>\d+).(?P<minor>\d+).(?P<version>\d+).", data ) | data = re.search( "^(tvtime: )?Running tvtime (?P<major>\d+).(?P<minor>\d+).(?P<version>\d+).", data ) | def isXmltvSupported(self): helpcmd = '%s --help' % config.TVTIME_CMD has_xmltv=False child = popen2.Popen3( helpcmd, 1, 100) data = child.childerr.readline() # Just need the first line if data: data = re.search( "^tvtime: Running tvtime (?P<major>\d+).(?P<minor>\d+).(?P<version>\d+).", data ) if data: _debug_("major ... |
return _ChannelHandler.icon(self, node) | data = {} for attr in (u'src', u'width', u'height'): if node.attrs.has_key(('', attr)): data[attr.encode(locale)] = _getxmlattr(node, attr) return data | def icon(self, node): return _ChannelHandler.icon(self, node) |
return _ChannelHandler.url(self, node) | return node.textof() | def url(self, node): return _ChannelHandler.url(self, node) |
(romName,romHL,romMem,romROM,romSRAM,romCountry,romLic,romVer,romICHK,romCHK) = unpack('21scccccccHH', romHeader) | try: (romName,romHL,romMem,romROM,romSRAM,romCountry,romLic,romVer,romICHK,romCHK) = unpack('21scccccccHH', romHeader) except: romCountry = chr(255) romLic = chr(51) romName = "unknown" break | def __init__(self, file, cmd = None, args = None, imgpath = None, parent = None): Item.__init__(self, parent) self.type = 'snes' # fix value self.set_url(file, info=True) self.parent = parent romName = '' |
info = None | media.info = DirItem(media.mountdir, None) | def identify(self, media): |
if os.path.isfile(config.COVER_DIR+os.path.splitext(os.path.basename(movie))[0]+'.png'): image = config.COVER_DIR+os.path.splitext(os.path.basename(movie))[0]+'.png' elif os.path.isfile(config.COVER_DIR+os.path.splitext(os.path.basename(movie))[0]+'.jpg'): image = config.COVER_DIR+os.path.splitext(os.path.basename(movi... | if os.path.isfile(config.COVER_DIR+\ os.path.splitext(os.path.basename(movie))[0]+'.png'): image = config.COVER_DIR+\ os.path.splitext(os.path.basename(movie))[0]+'.png' elif os.path.isfile(config.COVER_DIR+\ os.path.splitext(os.path.basename(movie))[0]+'.jpg'): image = config.COVER_DIR+\ os.path.splitext(os.path.basen... | def identify(self, media): |
if (not mplayer_files) and mp3_files: title = "AUDIO" , '%s [%s]' % (media.drivename, label) | elif (not mplayer_files) and mp3_files: media.info.handle_type = 'audio' title = '%s [%s]' % (media.drivename, label) | def identify(self, media): |
title = "IMAGES" , '%s [%s]' % (media.drivename, label) | media.info.handle_type = 'image' title = '%s [%s]' % (media.drivename, label) | def identify(self, media): |
title = "DATA" , '%s [%s]' % (media.drivename, label) | media.info.handle_type = None title = '%s [%s]' % (media.drivename, label) | def identify(self, media): |
title = "DATA" , '%s [%s]' % (media.drivename, label) media.info = DirItem(media.mountdir, None) | media.info.handle_type = None title = '%s [%s]' % (media.drivename, label) | def identify(self, media): |
media.info.handle_type = 'video' | def identify(self, media): | |
if recording.status == RECORDING: if recording.recorder[0] == self.plugin: self.rec.append(recording) return True else: return False | if recording.status == RECORDING and \ recording.recorder[0] != self.plugin: return False | def append(self, recording): """ Append recording to list of possible and return True. If not possible, do not append and return False. """ if not self.plugin: # dummy recorder, it is always possible not record it self.rec.append(recording) return True |
elif not show_name and config.COVER_DIR: if os.path.isfile(config.COVER_DIR+\ os.path.splitext(os.path.basename(movie))[0]+'.png'): image = config.COVER_DIR+\ os.path.splitext(os.path.basename(movie))[0]+'.png' elif os.path.isfile(config.COVER_DIR+\ os.path.splitext(os.path.basename(movie))[0]+'.jpg'): image = config.C... | elif (not show_name) and len(mplayer_files) == 1: movie = mplayer_files[0] if config.COVER_DIR: base = os.path.splitext(os.path.basename(movie))[0] base = os.path.join(config.COVER_DIR, base) image = util.getimage(base, image) | def identify(self, media): """ magic! Try to find out as much as possible about the disc in the rom drive: title, image, play options, ... """ # Check drive status (tray pos, disc ready) try: CDSL_CURRENT = ( (int ) ( ~ 0 >> 1 ) ) fd = os.open(media.devicename, os.O_RDONLY | os.O_NONBLOCK) if os.uname()[0] == 'FreeBSD'... |
print 'send update', c | log.info('send update to %s' % c) | def send_update(self): # send and updated list to the clients 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) |
print 'drawstringframed (%d;%d; w=%d; h=%d) "%s"' % (x, y, width, height, string) | print 'drawstringframedsoft (%d;%d; w=%d; h=%d) "%s"' % (x, y, width, height, string) | 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='...'): |
print "osd.drawstringframed_soft():\n\n%s\n" % lines | print "osd.drawstringframedsoft():\n\n%s\n" % lines | 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 = x if not return_x0 or return_x0 > x0: return_x0 = x0 | 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='...'): | |
else: | elif len( lines ) == 0: | 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 not return_x0 or return_x0 > x0: | if return_x0 > x0: | 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 not return_x1 or return_x1 < x0: return_x1 = x0 | 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 not rc.app: | if not 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__: __las... |
global main_menu_selected | def eventhandler(event = None, menuw=None, arg=None): if event == rc.IDENTIFY_MEDIA: if menuw.menustack[1] == menuw.menustack[-1]: main_menu_selected = menuw.all_items.index(menuw.menustack[1].selected) menuw.menustack[1].choices = main_menu_generate() global main_menu_selected menuw.menustack[1].selected = menuw.me... | |
if key in self.cache: | try: | def __setitem__(self, key, object): if isinstance(key, str): key = unicode(key, config.LOCALE) |
self.name = self.info.get('name') | self.name = Unicode(self.info.get('name')) | def set_url(self, url): """ Set a new url to the item and adjust all attributes depending on the url. Each MediaItem has to call this function. """ if isinstance(url, kaa.beacon.Item): self.info = url url = url.url else: log.error('FIXME: bad url %s', url) self.info = {} |
return self.options.eventhandler(event) | if hasattr(self,'options'): return self.options.eventhandler(event) else: return | def eventhandler(self, event, menuw=None): if DEBUG: print 'ProgramDisplay: event = %s' % event |
if self.media: | if need_umount: | def create_metainfo(self): """ create some metainfo for the directory """ display_type = self.display_type |
self.selected(new) | self.select(new) | def change_item(self, old, new): """ Replace the item 'old' with the 'new'. """ self.choices[self.choices.index(old)] = new if self.selected == old: self.selected(new) old.menu = None new.menu = weakref(self) |
(self.device_name, self.device_name) | (self.device_name, str((config.JOY_DEV - 1))) | def __init__(self): plugin.DaemonPlugin.__init__(self) |
if ((data[3] == 1) & (data[1] < 0)): | if ((data[3] == 1) & (data[1] < -16384)): | def poll(self): command = '' if DEBUG > 5: print 'self.joyfd = %s' % self.joyfd (r, w, e) = select.select([self.joyfd], [], [], 0) if DEBUG > 5: print 'r,w,e = %s,%s,%s' % (r,w,e) if r: c = os.read(self.joyfd, 8) else: return |
if ((data[3] == 1) & (data[1] > 0)): | if ((data[3] == 1) & (data[1] > 16384)): | def poll(self): command = '' if DEBUG > 5: print 'self.joyfd = %s' % self.joyfd (r, w, e) = select.select([self.joyfd], [], [], 0) if DEBUG > 5: print 'r,w,e = %s,%s,%s' % (r,w,e) if r: c = os.read(self.joyfd, 8) else: return |
if ((data[3] == 0) & (data[1] < 0)): | if ((data[3] == 0) & (data[1] < -16384)): | def poll(self): command = '' if DEBUG > 5: print 'self.joyfd = %s' % self.joyfd (r, w, e) = select.select([self.joyfd], [], [], 0) if DEBUG > 5: print 'r,w,e = %s,%s,%s' % (r,w,e) if r: c = os.read(self.joyfd, 8) else: return |
if ((data[3] == 0) & (data[1] > 0)): | if ((data[3] == 0) & (data[1] > 16384)): | def poll(self): command = '' if DEBUG > 5: print 'self.joyfd = %s' % self.joyfd (r, w, e) = select.select([self.joyfd], [], [], 0) if DEBUG > 5: print 'r,w,e = %s,%s,%s' % (r,w,e) if r: c = os.read(self.joyfd, 8) else: return |
usage() | sys.exit(0) | def grab_xmltv(): if not config.XMLTV_GRABBER: print 'No program found to grab the listings. Please set XMLTV_GRABBER' print 'in local.conf.py to the grabber you need' print usage() print 'Grabbing listings using XMLTV.' xmltvtmp = '/tmp/TV.xml.tmp' os.system('%s --output %s --days %s' % ( config.XMLTV_GRABBER, xmltv... |
if m and not os.path.exists(filename + ".jpg"): | if os.path.exists(filename + ".jpg"): image = filename + ".jpg" elif m: | def str2XML(line): return unicode(string.replace(line, "&", "&"), 'latin-1') |
i.write(" <cover source=\"%s\">%s</cover>\n" % (url.group(1), str2XML(image))) | try: i.write(" <cover source=\"%s\">%s</cover>\n" % (url.group(1), str2XML(image))) except: i.write(" <cover>%s</cover>\n" % str2XML(image)) | def str2XML(line): return unicode(string.replace(line, "&", "&"), 'latin-1') |
log.info('save %s' % self.cachefile) | log.debug('save %s' % self.cachefile) | def save(self, later=True): """ Save the cache. """ if not self.changed: return if later: self.__save_timer.start(0) return log.info('save %s' % self.cachefile) cache.save(self.cachefile, self.data, VERSION) self.mtime = os.stat(self.cachefile)[ST_MTIME] self.changed = False |
str(item.info['delay'])) | '-' + str(item.info['delay'])) | def play(self, filename, options, item, mode = None): """ play a videoitem with mplayer """ |
print 'ERROR: no prog' return | return (FALSE, 'no prog') | def scheduleRecording(prog=None): if not prog: print 'ERROR: no prog' return if prog.stop < time.time(): print 'ERROR: cannot record it if it is over' return try: (status, message) = server.scheduleRecording(marmalade.jellyToXML(prog)) except: return (FALSE, 'record_client: connection error') return (status, message... |
print 'ERROR: cannot record it if it is over' return | return (FALSE, 'ERROR: cannot record it if it is over') | def scheduleRecording(prog=None): if not prog: print 'ERROR: no prog' return if prog.stop < time.time(): print 'ERROR: cannot record it if it is over' return try: (status, message) = server.scheduleRecording(marmalade.jellyToXML(prog)) except: return (FALSE, 'record_client: connection error') return (status, message... |
try: (status, message) = server.scheduleRecording(marmalade.jellyToXML(prog)) except: | progxml = marmalade.jellyToXML(prog) progxml = string.replace(progxml,'tv.','') try: (status, message) = server.scheduleRecording(progxml) except: traceback.print_exc() | def scheduleRecording(prog=None): if not prog: print 'ERROR: no prog' return if prog.stop < time.time(): print 'ERROR: cannot record it if it is over' return try: (status, message) = server.scheduleRecording(marmalade.jellyToXML(prog)) except: return (FALSE, 'record_client: connection error') return (status, message... |
if self.__proc: self.__proc.write(cmd) | if self.__child: self.__child.write(line) | def child_stdin(self, line): """ Send line to child. """ if self.__proc: self.__proc.write(cmd) |
plugin.getbyname('osd').draw(('osd', None), osd) | plugin.getbyname('osd').draw(('osd', None), self.osd) | def view(self, item, zoom=0, rotation=0): filename = item.filename |
DrawTextFramed('%s ' % info.title, iv, x=left, y=top, width=500, height=35, mode='soft') | DrawTextFramed('%s ' % info.title, iv, x=left, y=top, width=500, height=-1, mode='soft') | def DrawMP3(self, info): |
DrawTextFramed('%s ' % info.artist, iv, x=left, y=top, width=500,height=35, mode='soft') | DrawTextFramed('%s ' % info.artist, iv, x=left, y=top, width=500,height=-1, mode='soft') | def DrawMP3(self, info): |
DrawTextFramed('%s ' % info.album, iv, x=left, y=top, width=500,height=35, mode='soft') | DrawTextFramed('%s ' % info.album, iv, x=left, y=top, width=500,height=-1, mode='soft') | def DrawMP3(self, info): |
orgin = self.x width = self.w | origin = self.x width = self.w | def draw(self, (type, object), osd): """ draws the bar """ if self.status == BAR_SHOW: font = osd.get_font('detachbar') |
lame_command = config.LAME_CMD + ' -h ' \ | lame_command = config.LAME_CMD + ' --nohist -h ' \ | def cd_backup_threaded(self, device, rip_format='mp3'): if DEBUG: print 'cd_backup_threaded function, rip_format = %s' %rip_format rip_format = rip_format album = 'default_album' artist = 'default_artist' genre = 'default_genre' dir_audio_default = "dir_audio_default" path_head = '' # Get the artist, album and song_na... |
special_chars = [ '\"', '\`', '\\\\', '/','\'' ] | special_chars = [ '\"', '\`', '\\\\', '/','~' ] | def replace_special_char(self, string, repl='-'): # Regular Expression Special Chars = . ^ $ * + ? { [ ] \ | ( ) special_chars = [ '\"', '\`', '\\\\', '/','\'' ] """ special_chars = [ '~', '!', '@', '\\$', '%', \ '\\*', '\\|', ':', \ '\"', '\\?', '\`', '\\\\', \ ';', "\'", '/' ] """ # '~', '!', '@', '# ', '\\$', ... |
if (pattern == '\''): (new_string, num) = re.subn(pattern, '\\\'', new_string, count=0) | if (pattern == "\'"): (new_string, num) = re.subn(pattern, "\\\'", new_string, count=0) | def replace_special_char(self, string, repl='-'): # Regular Expression Special Chars = . ^ $ * + ? { [ ] \ | ( ) special_chars = [ '\"', '\`', '\\\\', '/','\'' ] """ special_chars = [ '~', '!', '@', '\\$', '%', \ '\\*', '\\|', ':', \ '\"', '\\?', '\`', '\\\\', \ ';', "\'", '/' ] """ # '~', '!', '@', '# ', '\\$', ... |
(None, None, self.s_w, self.s_h) = self.region_surface_rect \ = self.region_surface.get_rect() | (self.s_w, self.s_h) = self.region_surface_rect \ = self.region_surface.get_rect()[2:4] | def set_surface(self, surface): self.region_surface = surface |
return self._image.save(filename) | if not format: format = os.path.splitext(filename)[1][1:] return self._image.save(filename, format) | def save(self, filename, format = None): """ Saves the image to a file. |
mediadb.watcher.cwd(self.listing, callback) | def reload(self): """ called when we return to this menu """ callback = notifier.Callback(self.build, 'update', self.menuw) if self.needs_update: log.info('directory needs update') callback() else: mediadb.watcher.cwd(self.listing, callback) mediadb.watcher.check() # we changed the menu, don't build a new one return No... | |
osd.clearscreen() osd.drawstring('File "%s" not found!' % filename, 30, 280) osd.update() time.sleep(2.0) menuwidget.refresh() | if DEBUG: print "xmms file_not_found %s " % (filename,) if xmms.is_running(): globals.rc.post_event(globals.rc.RIGHT) else: skin.PopupBox('File "%s" not found!' % filename) time.sleep(3.0) menuwidget.refresh() | def file_not_found(self, filename): osd.clearscreen() osd.drawstring('File "%s" not found!' % filename, 30, 280) osd.update() time.sleep(2.0) menuwidget.refresh() |
time.sleep(2) notdone = 1 while notdone: try: notdone = 0 except: pass time.sleep(0.1) | def _set_app(self): if self.app == None: self.app = self.__class__.AppClass(self.command) time.sleep(2) notdone = 1 while notdone: try: notdone = 0 except: pass time.sleep(0.1) | |
if DEBUG: print "xmms play pos: %s last_file: %s " % (pos,last_file) | def eventhandler(self, event): if event == globals.rc.STOP: self.stop () self._return_to_menu() | |
self.file_not_found(filename) self.mode = mode self.repeat = repeat globals.osd.clearscreen(color=globals.osd.COL_BLACK) globals.osd.drawstring('Playing "%s" with xmms' % os.path.basename(filename), 30, 280, fgcolor=globals.osd.COL_ORANGE, bgcolor=globals.osd.COL_BLACK) globals.osd.update() self.set_mixer_levels() ... | self.file_not_found(filename) else: self.mode = mode self.repeat = repeat globals.skin.PopupBox("Lanching xmms.") self.set_mixer_levels() self.thread.mode = constants.playmode self.thread.reset_alive() self.thread.command = self.build_play_command() self.thread.mode_flag.set() globals.rc.app = self.eventhandler | def play(self, mode, filename, playlist, repeat=1): |
xmms.play_files((self.filename,)) xmms.main_win_toggle(0) | timeout = 10.0 counter = 0.0 increment = 0.1 while 1: if xmms.is_running(): if DEBUG: print "xmms is running" xmms.play_files((self.filename,)) xmms.main_win_toggle(0) break elif counter >= timeout: if DEBUG: print "xmms timeout" menuwidget.refresh() skin.PopupBox("Timed launching xmms.") time.sleep(3) menuwidget.refre... | def load_and_play(self): xmms.play_files((self.filename,)) xmms.main_win_toggle(0) |
for row in table[0]: w = max(w, osd.stringsize(row, font=font.name, ptsize=font.size)[0]) if x0 + w > content.x + content.width: w = content.x + content.width - x0 | for i in range(0,len(table[0])): if table[1][i]: w = max(w, osd.stringsize(table[0][i], font=font.name, ptsize=font.size)[0]) if x0 + w > content.x + content.width: w = content.x + content.width - x0 | def update_content(self): """ update the info area """ content = self.calc_geometry(self.layout.content, copy_object=TRUE) item = self.infoitem |
rec = self.write_text(table[0][i], font, content, x=x0, y=y0, width=w, | rec = self.write_text(table[0][i], font, content, x=x0, y=y0, width=content.width, | def update_content(self): """ update the info area """ content = self.calc_geometry(self.layout.content, copy_object=TRUE) item = self.infoitem |
if vfs.isoverlay(f): d = vfs.getoverlay(destdir) else: d = destdir if not os.path.isdir(d): os.makedirs(d) shutil.copy(f, d) | if not os.path.isdir(destdir): os.makedirs(destdir) shutil.copy(f, destdir) | def copy(self, destdir): """ Copy all files to destdir. """ for f in self.files + [ self.fxd_file, self.image ]: if f: if vfs.isoverlay(f): d = vfs.getoverlay(destdir) else: d = destdir if not os.path.isdir(d): os.makedirs(d) shutil.copy(f, d) |
if vfs.isoverlay(f): d = vfs.getoverlay(destdir) else: d = destdir if not os.path.isdir(d): os.makedirs(d) os.system('mv "%s" "%s"' % (f, d)) | if not os.path.isdir(destdir): os.makedirs(destdir) os.system('mv "%s" "%s"' % (f, destdir)) | def move(self, destdir): """ Move all files to destdir. """ for f in self.files + [ self.fxd_file, self.image ]: if f: if vfs.isoverlay(f): d = vfs.getoverlay(destdir) else: d = destdir if not os.path.isdir(d): os.makedirs(d) os.system('mv "%s" "%s"' % (f, d)) |
self.info = mediadb.ItemInfo('', '', {}) | self.info = mediadb.item() | def __init__(self, parent=None, info=True): """ Init the item. Sets all needed variables, if parent is given also inherit some settings from there. """ if not hasattr(self, 'type'): self.type = None # e.g. video, audio, dir, playlist |
self.__initialized = False | def __init__(self, parent=None, info=True): """ Init the item. Sets all needed variables, if parent is given also inherit some settings from there. """ if not hasattr(self, 'type'): self.type = None # e.g. video, audio, dir, playlist | |
self.info = mediadb.get(url[url.find('://')+3:]) | if url.find('://') > 0: url = url[url.find('://')+3:] self.info = mediadb.get(url) url = self.info.url | def set_url(self, url, search_cover=True): """ Set a new url to the item and adjust all attributes depending on the url. Each MediaItem has to call this function. If info is True, search for additional information in mediadb. """ if isinstance(url, mediadb.ItemInfo): self.info = url url = url.url else: if url: log.erro... |
self.info = mediadb.ItemInfo('', '', {}) | self.info = mediadb.item() | def set_url(self, url, search_cover=True): """ Set a new url to the item and adjust all attributes depending on the url. Each MediaItem has to call this function. If info is True, search for additional information in mediadb. """ if isinstance(url, mediadb.ItemInfo): self.info = url url = url.url else: if url: log.erro... |
self.name = self.info['title:filename'] | self.name = self.info[FILETITLE] | def set_url(self, url, search_cover=True): """ Set a new url to the item and adjust all attributes depending on the url. Each MediaItem has to call this function. If info is True, search for additional information in mediadb. """ if isinstance(url, mediadb.ItemInfo): self.info = url url = url.url else: if url: log.erro... |
cover = self.info['cover'] | cover = self.info[COVER] | def set_url(self, url, search_cover=True): """ Set a new url to the item and adjust all attributes depending on the url. Each MediaItem has to call this function. If info is True, search for additional information in mediadb. """ if isinstance(url, mediadb.ItemInfo): self.info = url url = url.url else: if url: log.erro... |
self.image = self.info['cover'] | self.image = self.info[COVER] | def set_url(self, url, search_cover=True): """ Set a new url to the item and adjust all attributes depending on the url. Each MediaItem has to call this function. If info is True, search for additional information in mediadb. """ if isinstance(url, mediadb.ItemInfo): self.info = url url = url.url else: if url: log.erro... |
'/*.[oO][gG][mM]' | '/*.[oO][gG][mM]', '/*.[vV][oO][bB]', | def ConfigInit(videotools = 'sim'): print 'VIDEOTOOLS = %s' % videotools global MPLAYER_CMD, MPLAYER_ARGS_MPG, MPLAYER_ARGS_DVD, MPLAYER_ARGS_VCD global MPLAYER_ARGS_DVDNAV, VIDREC_MQ, VIDREC_HQ # # There are two sets of tool settings, one for a real box, # and one for development. # if videotools == 'real': MPLAYER_... |
raise ValueError, "Unsupported image type", type(image) | raise ValueError, "Unsupported image type %s" % type(image_or_filename) | def __init__(self, image_or_filename): """ Create a new Image object. |
print 'can\'t find image %s' % file | _debug_('can\'t find image %s' % file) | def search_file(file, search_dirs): for s_dir in search_dirs: dfile=os.path.join(s_dir, file) if os.path.isfile(dfile): return dfile if os.path.isfile("%s_%sx%s.png" % (dfile, config.CONF.width, config.CONF.height)): return "%s_%sx%s.png" % (dfile, config.CONF.width, config.CONF.height) if os.path.isfile("%s_%sx%s.jpg... |
break else: return 1 | def load(self, file, copy_content = 0, prepare = TRUE, clear=FALSE): """ load and parse the skin file """ | |
except Exception, e: | except: | def __init__(self, use_pylirc=1, use_netremote=1): |
self.inputs.append(Keyboard()) | try: self.inputs.append(Keyboard()) except: pass | def __init__(self, use_pylirc=1, use_netremote=1): |
if config.ROM_SPEED and not data.mime == 'video/dvd': | if config.ROM_SPEED and data and not data.mime == 'video/dvd': | def identify(self, media): """ magic! Try to find out as much as possible about the disc in the rom drive: title, image, play options, ... """ # Check drive status (tray pos, disc ready) try: fd = os.open(media.devicename, os.O_RDONLY | os.O_NONBLOCK) s = ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT) except: # maybe we n... |
self.poll_intervall = 3 | self.poll_interval = 1 | def __init__(self): plugin.DaemonPlugin.__init__(self) |
if self.items.files: self.items.files.move(local_to_dir) | if self.item.files: self.item.files.move(local_to_dir) | def mover_to_series(self, arg=None, menuw=None): # make to_dir an absolute path local_to_dir = self.to_dir if not os.path.isabs(self.to_dir): local_to_dir = os.path.join(os.path.dirname(self.item.filename), self.to_dir) |
if not self.plugin: self.rec.append(recording) return True | def append(self, recording): """ Append recording to list of possible and return True. If not possible, do not append and return False. """ recording.conflict_padding = [] if recording.status == RECORDING: # the recording is running right now, do not move it to # a new plugin if recording.recorder[0] == self.plugin: # ... | |
pass | def clear_cache(): """ Clear the global conflict resolve cache """ pass | |
global _devices | def clear_cache(): """ Clear the global conflict resolve cache """ pass | |
_devices = [] | def clear_cache(): """ Clear the global conflict resolve cache """ pass | |
self.selected = self.channel.get(self.current_time)[0] | try: self.selected = self.channel.get(self.current_time)[0] except Exception, e: print e print self.current_time | def eventhandler(self, event): if MenuApplication.eventhandler(self, event): return True |
secs = time.mktime(strptime.strptime(tval, xmltv.date_format_notz)) | tmTuple = ( int(tval[0:4]), int(tval[4:6]), int(tval[6:8]), int(tval[8:10]), int(tval[10:12]), 0, -1, -1, -1 ) secs = calendar.timegm( tmTuple ) | def timestr2secs_utc(str): # This is either something like 'EDT', or '+1' try: tval, tz = str.split() except ValueError: # The time value couldn't be decoded raise EPG_TIME_EXC # Is it the '+1' format? if tz[0] == '+' or tz[0] == '-': secs = time.mktime(strptime.strptime(tval, xmltv.date_format_notz)) adj_neg = int(tz... |
object.width = self.area_val.width + int(object.width[4:]) | object.width = self.area_val.width + int(object.width[3:]) | def calc_geometry(self, object, copy_object=0): """ calculate the real values of the object (e.g. content) based on the geometry of the area """ if copy_object: object = copy.copy(object) |
object.height = self.area_val.height + int(object.height[4:]) | object.height = self.area_val.height + int(object.height[3:]) | def calc_geometry(self, object, copy_object=0): """ calculate the real values of the object (e.g. content) based on the geometry of the area """ if copy_object: object = copy.copy(object) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.