rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
mediainfo.del_cache()
util.mediainfo.del_cache()
def cache_directories(rebuild): """ cache all directories with mmpython rebuild: 0 no rebuild 1 rebuild all files on disc 2 like 1, but also delete discinfo data """ if rebuild: print 'deleting cache files..................................', sys.__stdout__.flush() mediainfo.del_cache() print 'done' all_dirs = []...
bmovl plugin fro mplayer
bmovl plugin for mplayer
def update(self, rect): _debug_('update bmovl') update = self.screen.subsurface(rect) 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'))
To activate, you need to create a fifo /tmp/bmovl.
To activate, you need to create a fifo /tmp/bmovl (mkfifo /tmp/bmovl).
def update(self, rect): _debug_('update bmovl') update = self.screen.subsurface(rect) 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'))
print ' - the second is port which defaults to 16130'
print ' - the second is port which defaults to 16310'
def usage(): print 'a small tkinter example remote program' print 'You need to set ENABLE_NETWORK_REMOTE = 1 in you local_conf.py' print print 'It takes two optional arguments:' print ' - the first is host which defaults to localhost' print ' - the second is port which defaults to 16130' print print 'when run wit...
print 'when run with no args it connects to the localhost on port 16130'
print 'when run with no args it connects to the localhost on port 16310'
def usage(): print 'a small tkinter example remote program' print 'You need to set ENABLE_NETWORK_REMOTE = 1 in you local_conf.py' print print 'It takes two optional arguments:' print ' - the first is host which defaults to localhost' print ' - the second is port which defaults to 16130' print print 'when run wit...
print 'when run with one arg it connects to the given host on port 16130'
print 'when run with one arg it connects to the given host on port 16310'
def usage(): print 'a small tkinter example remote program' print 'You need to set ENABLE_NETWORK_REMOTE = 1 in you local_conf.py' print print 'It takes two optional arguments:' print ' - the first is host which defaults to localhost' print ' - the second is port which defaults to 16130' print print 'when run wit...
pb = PasswordInputBox(text=_('Enter Password'), handler=self.pass_cmp_cp)
pb = PasswordInputBox(text=_('Enter Password'), handler=self.pass_cmp_cb)
def check_password_and_build(self, arg=None, menuw=None): """ password checker """ if not self.menuw: self.menuw = menuw
key.K_l : 'SUBTITLE'
key.K_l : 'SUBTITLE', key.K_a : 'LANG'
def __cmp__(self, other): """ compare function, return 0 if the objects are identical, 1 otherwise """ if not other: return 1 if isinstance(other, Event): return self.name != other.name return self.name != other
self.lastupdate = 0.0
def __init__( self, file, drawall=0 ): self.drawall = drawall self.filename = file self.album = '' self.artist = '' self.length = 0 self.title = 0 self.track = 0 self.year = 0 self.start = 0 self.elapsed = 0 self.remain = 0 self.done = 0.0 self.image = '' self.la...
if 'ALBUM' in vc.keys(): self.album = vc['ALBUM'][0] else: self.album = ''
try: if 'ALBUM' in vc.keys(): self.album = vc['ALBUM'][0] else: self.album = ''
def set_info_ogg( self, file ): """ Sets all the info variables with useful info from the oggfile.
if 'YEAR' in vc.keys(): self.year = vc['YEAR'][0] else: self.year = ''
if 'YEAR' in vc.keys(): self.year = vc['YEAR'][0] else: self.year = '' except UnicodeError: if DEBUG: print "Oops, got UnicodeError"
def set_info_ogg( self, file ): """ Sets all the info variables with useful info from the oggfile.
if time.time() > (self.lastupdate + 0.5):
if time.time() > (self.__lastupdate + 0.5):
def draw( self ): """ Give information to the skin.. """ # done = round((float(elapsed) / total) * 100.0)
self.lastupdate = time.time()
self.__lastupdate = time.time()
def draw( self ): """ Give information to the skin.. """ # done = round((float(elapsed) / total) * 100.0)
items = [ (self.shutdown_system, _('Shutdown system') ), (self.shutdown_freevo, _('Shutdown Freevo') ), (self.shutdown_system_restart, _('Restart system') ) ]
items = [ items[1], items[0], item[2] ]
def actions(self): """ return a list of actions for this item """ if config.CONFIRM_SHUTDOWN: items = [ (self.confirm_freevo, _('Shutdown Freevo') ), (self.confirm_system, _('Shutdown system') ), (self.confirm_system_restart, _('Restart system') ) ] else: items = [ (self.shutdown_freevo, _('Shutdown Freevo') ), (self.s...
if self.replex and self.program == 'tzap':
if self.replex:
def __init__(self, device='dvb0', rating=0): self.name = device self.device = config.TV_CARDS[device]
return '%0.3i-%s' % (int(self['trackno']), Unicode(self.url))
return '%s %0.3i-%s' % (self['discs'],int(self['trackno']), Unicode(self.url))
def sort(self, mode=None): """ Returns the string how to sort this item """ if mode == 'date': if self.filename: return u'%s%s' % (os.stat(self.filename).st_ctime, Unicode(self.filename)) if mode == 'advanced': # sort by track number try: return '%0.3i-%s' % (int(self['trackno']), Unicode(self.url)) except ValueError: ...
return self.tunerSetFreq(vg.tuner_chan, app, app_cmd)
freq = self.tunerSetFreq(vg.tuner_chan, app, app_cmd)
def chanSet(self, chan, app=None, app_cmd=None): new_chan = None
if not rc.app:
if not rc.func:
def main_func(): # Add the drives to the config.removable_media list. There doesn't have # to be any drives defined. if config.ROM_DRIVES != None: for i in range(len(config.ROM_DRIVES)): (dir, device, name) = config.ROM_DRIVES[i] media = RemovableMedia(mountdir=dir, devicename=device, drivename=name) # close the tray ...
m and m.refresh()
if not rc.func: m and m.refresh()
def main_func(): # Add the drives to the config.removable_media list. There doesn't have # to be any drives defined. if config.ROM_DRIVES != None: for i in range(len(config.ROM_DRIVES)): (dir, device, name) = config.ROM_DRIVES[i] media = RemovableMedia(mountdir=dir, devicename=device, drivename=name) # close the tray ...
self.name = show_name[0] + " " + show_name[1] + "x" + show_name[2] +\ " - " + show_name[3] if os.path.isfile((config.TV_SHOW_DATA_DIR + show_name[0] + ".png").lower()): self.image = (config.TV_SHOW_DATA_DIR + show_name[0] + ".png").lower() elif os.path.isfile((config.TV_SHOW_DATA_DIR + show_name[0] + ".jpg").lower()):...
if show_name[0] and show_name[1] and show_name[2] and show_name[3]: self.name = show_name[0] + " " + show_name[1] + "x" + show_name[2] +\ " - " + show_name[3] if os.path.isfile((config.TV_SHOW_DATA_DIR + show_name[0] + ".png").lower()): self.image = (config.TV_SHOW_DATA_DIR + show_name[0] + ".png").lower() elif os.path...
def __init__(self, filename, parent, info=None): if parent and parent.media: url = 'cd://%s:%s:%s' % (parent.media.devicename, parent.media.mountdir, filename[len(parent.media.mountdir)+1:]) else: url = filename
self.chan_dict[program.channel_id].programs[-1]
String(self.chan_dict[program.channel_id].programs[-1])
def AddProgram(self, program): # The channel must be present, or the program is # silently dropped if self.chan_dict.has_key(program.channel_id): p = self.chan_dict[program.channel_id].programs if len(p) and p[-1].start < program.stop and p[-1].stop > program.start: # the tv guide is corrupt, the last entry has a stop ...
elif choice.type == 'list':
elif choice.type == 'playlist':
def DrawMenu_Selection(self, menuw, settings, x0, y0, width, height): val = settings menu = menuw.menustack[-1]
spacing = font_h + PADDING if font_w + 26 > width: text = text + "..." while font_w + 26 > width: text = text[0:-4] + "..." font_w, font_h = osd.stringsize(text, font=obj.font, ptsize=obj.size)
spacing = font_h + PADDING
def DrawMenu_Selection(self, menuw, settings, x0, y0, width, height): val = settings menu = menuw.menustack[-1]
DrawText(text, obj, x=x0, y=top) if choice.icon != None: icon_x = x0 - icon_size - 15 icon_y = y0 - (icon_size - font_h) / 2 osd.drawbitmap(util.resize(choice.icon, icon_size, icon_size), icon_x, icon_y)
DrawTextFramed(text, obj, x=x0+ icon_present*icon_size*1.2, y=top, width=width,height=font_h, mode='hard')
def DrawMenu_Selection(self, menuw, settings, x0, y0, width, height): val = settings menu = menuw.menustack[-1]
prio = int(app[7:app.find(' ')])
prio = int(app[0][7:])
def __init__(self, app, debugname=None, doeslogging=0): self.lock = thread.allocate_lock()
media.info = videoitem.VideoItem(None, None)
media.info = videoitem.VideoItem('0', None)
def identify(self, media):
file=os.path.join(c_dir, file) if os.path.isfile(file): return file if os.path.isfile("%s_%sx%s.png" % (file, config.CONF.width,
dfile=os.path.join(c_dir, file) if os.path.isfile(dfile): return dfile if os.path.isfile("%s_%sx%s.png" % (dfile, config.CONF.width,
def attr_file(node, attr, default, c_dir): if node.attrs.has_key(('', attr)): file = node.attrs[('', attr)].encode('latin-1') if file: file=os.path.join(c_dir, file) if os.path.isfile(file): return file if os.path.isfile("%s_%sx%s.png" % (file, config.CONF.width, config.CONF.height)): return "%s_%sx%s.png" % (file, con...
return "%s_%sx%s.png" % (file, config.CONF.width, config.CONF.height) if os.path.isfile("%s_%sx%s.jpg" % (file, config.CONF.width,
return "%s_%sx%s.png" % (dfile, config.CONF.width, config.CONF.height) if os.path.isfile("%s_%sx%s.jpg" % (dfile, config.CONF.width,
def attr_file(node, attr, default, c_dir): if node.attrs.has_key(('', attr)): file = node.attrs[('', attr)].encode('latin-1') if file: file=os.path.join(c_dir, file) if os.path.isfile(file): return file if os.path.isfile("%s_%sx%s.png" % (file, config.CONF.width, config.CONF.height)): return "%s_%sx%s.png" % (file, con...
return "%s_%sx%s.jpg" % (file, config.CONF.width, config.CONF.height) if config.CONF.width == 720 and os.path.isfile("%s_768x576.png" % file): return "%s_768x576.png" % file if config.CONF.width == 720 and os.path.isfile("%s_768x576.jpg" % file): return "%s_768x576.jpg" % file if os.path.isfile("%s_800x600.png" % file)...
return "%s_%sx%s.jpg" % (dfile, config.CONF.width, config.CONF.height) if config.CONF.width == 720 and os.path.isfile("%s_768x576.png" % dfile): return "%s_768x576.png" % dfile if config.CONF.width == 720 and os.path.isfile("%s_768x576.jpg" % dfile): return "%s_768x576.jpg" % dfile if os.path.isfile("%s_800x600.png" % ...
def attr_file(node, attr, default, c_dir): if node.attrs.has_key(('', attr)): file = node.attrs[('', attr)].encode('latin-1') if file: file=os.path.join(c_dir, file) if os.path.isfile(file): return file if os.path.isfile("%s_%sx%s.png" % (file, config.CONF.width, config.CONF.height)): return "%s_%sx%s.png" % (file, con...
v.mode, v.media_id, v.mplayer_options = id[ref][2:]
v.mode, v.media_id, v.mplayer_options, player, is_playlist = id[ref][2:] if player: v.force_player = player if is_playlist: v.is_playlist = True
def parse_video_child(fxd, node, item, dirname): """ parse a subitem from <video> """ filename = fxd.gettext(node) mode = node.name id = fxd.getattr(node, 'id') media_id = fxd.getattr(node, 'media_id') options = fxd.getattr(node, 'mplayer_options') player = fxd.childcontent(node, 'player') play...
util.save_pickle(mameRomList)
util.save_pickle(mameRomList, config.MAME_CACHE)
def saveMameRomList(mameRomList): if not mameRomList or mameRomList == None: mameRomList = mame_types.MameRomList() util.save_pickle(mameRomList)
display_type = self.display_type if self.display_type == 'tv': display_type = 'video'
def build(self, arg=None, menuw=None): """ build the items for the directory """ self.playlist = [] self.play_items = [] self.dir_items = [] self.pl_items = []
Compares strings after stripping off 'The' to be "smarter" Also obviously ignores the full path when looking for 'The'
Compares strings after stripping off 'The' and 'A' to be 'smarter' Also obviously ignores the full path when looking for 'The' and 'A'
def smartsort(x,y): # A compare function for use in list.sort() """ Compares strings after stripping off 'The' to be "smarter" Also obviously ignores the full path when looking for 'The' """ m = os.path.basename(x) n = os.path.basename(y) if m.find('The ') == 0: m = m.replace('The ','',1) if n.find('The ') == 0: n = n...
if m.find('The ') == 0: m = m.replace('The ','',1) if n.find('The ') == 0: n = n.replace('The ','',1)
for word in ('The', 'A'): word += ' ' if m.find(word) == 0: m = m.replace(word, '', 1) if n.find(word) == 0: n = n.replace(word, '', 1)
def smartsort(x,y): # A compare function for use in list.sort() """ Compares strings after stripping off 'The' to be "smarter" Also obviously ignores the full path when looking for 'The' """ m = os.path.basename(x) n = os.path.basename(y) if m.find('The ') == 0: m = m.replace('The ','',1) if n.find('The ') == 0: n = n...
print 'FAV: name=%s mod=%s' % (fav.name, fav.mod)
def get_items(self): items = []
if self.parent and hasattr(parent, 'skin_display_type'): self.skin_display_type = parent.skin_display_type elif parent: self.skin_display_type = parent.display_type else: self.skin_display_type = display_type
def __init__(self, directory, parent, name = '', display_type = None, add_args = None): Playlist.__init__(self, parent=parent, display_type=display_type) self.type = 'dir' self.item_menu = None self.needs_update = False
possible_display_types = [ ]
possible = [ ]
def eventhandler(self, event, menuw=None): if event == DIRECTORY_CHANGE_DISPLAY_TYPE and self.item_menu.visible: possible_display_types = [ ]
if not t in possible_display_types: possible_display_types.append(t)
if not t in possible: possible.append(t)
def eventhandler(self, event, menuw=None): if event == DIRECTORY_CHANGE_DISPLAY_TYPE and self.item_menu.visible: possible_display_types = [ ]
pos = possible_display_types.index(self.display_type) type = possible_display_types[(pos+1) % \ len(possible_display_types)] self.get_menustack().delete_menu(allow_reload = False) newdir = DirItem(self.dir, self.parent, self.name, type, self.add_args) newdir.DIRECTORY_AUTOPLAY_SINGLE_ITEM = False newdir.cwd() self.g...
pos = possible.index(self.display_type) type = possible[(pos+1) % len(possible)] except (IndexError, ValueError), e: return Playlist.eventhandler(self, event) self.get_menustack().delete_menu(allow_reload = False) d = DirItem(self.dir, self.parent, self.name, type, self.add_args) d.DIRECTORY_AUTOPLAY_SINGLE_ITEM =...
def eventhandler(self, event, menuw=None): if event == DIRECTORY_CHANGE_DISPLAY_TYPE and self.item_menu.visible: possible_display_types = [ ]
item_types = self.skin_display_type,
item_types = display_type,
def browse(self, update=False): """ build the items for the directory """ # FIXME: add password checking here if update and not (self.listing and self.item_menu.visible): # not visible right now, do not update self.needs_update = True return
item = copy.copy(self.get_menustack()[-1].selected)
item = self.get_menustack().get_selected()
def configure_set_var(self, var): """ Update the variable in var and change the menu. This function is used by 'configure' """
m = self.get_menustack()[-1] m.choices[m.choices.index(m.selected)] = item m.selected = item
def configure_set_var(self, var): """ Update the variable in var and change the menu. This function is used by 'configure' """
item = copy.copy(self.get_menustack()[-1].selected)
item = self.get_menustack().get_selected()
def configure_set_display_type(self): """ change display type from specific to all """ if self.display_type: self['show_all_items'] = True self.display_type = None name = u'\tICON_RIGHT_ON_' + _('on') else: self['show_all_items'] = False self.display_type = self.parent.display_type name = u'\tICON_RIGHT_OFF_' + _('off'...
m = self.get_menustack()[-1] m.choices[m.choices.index(m.selected)] = item m.selected = item
def configure_set_display_type(self): """ change display type from specific to all """ if self.display_type: self['show_all_items'] = True self.display_type = None name = u'\tICON_RIGHT_ON_' + _('on') else: self['show_all_items'] = False self.display_type = self.parent.display_type name = u'\tICON_RIGHT_OFF_' + _('off'...
file = os.path.join( self.senspath, self.sensor )
if self.k6 : file = os.path.join( self.senspath, 'temp_input' + self.sensor[-1] ) fhot = os.path.join( self.senspath, 'temp_max' + self.sensor[-1] ) f = open(fhot) hotdata = f.read() f.close() else: file = os.path.join( self.senspath, self.sensor )
def temp_compute (rawvalue): try: temperature = eval(self.compute_expression.replace ("@",str(rawvalue))) except: print "ERROR in idlebar.sensors: Compute expression does not evaluate" temperature = rawvalue return int(temperature)
temp = int(temp_compute (float(string.split(data)[2]))) hot = int(temp_compute (float(string.split(data)[0])))
if self.k6: temp = int(temp_compute(float(data[0:2]))) hot = int(temp_compute(float(hotdata[0:2]))) else: temp = int(temp_compute (float(string.split(data)[2]))) hot = int(temp_compute (float(string.split(data)[0])))
def temp_compute (rawvalue): try: temperature = eval(self.compute_expression.replace ("@",str(rawvalue))) except: print "ERROR in idlebar.sensors: Compute expression does not evaluate" temperature = rawvalue return int(temperature)
print "LM_Sensors proc data not available? Did you load i2c-proc" print "and configured lm_sensors?" print "temperatures will be bogus"
if self.k6: print "Kernel 2.5/2.6 detected, but no i2c sensors found" print "Did u load (or compile) the necessary bus driver" print "and sensor chip modules" else: print "LM_Sensors proc data not available? Did you load i2c-proc" print "and configured lm_sensors?" print "temperatures will be bogus"
def getSensorPath(self): if not os.path.exists(self.initpath): print "LM_Sensors proc data not available? Did you load i2c-proc" print "and configured lm_sensors?" print "temperatures will be bogus" return -1 #failure for senspath in os.listdir(self.initpath): testpath = os.path.join(self.initpath , senspath) if os.pa...
frequency = get_frequency(channel, self.settings.chanlist)
freq = get_frequency(channel, self.settings.chanlist)
def setchannel(self, channel): if self.settings: frequency = get_frequency(channel, self.settings.chanlist) else: frequency = get_frequency(channel)
frequency = get_frequency(channel) if not frequency:
freq = get_frequency(channel) if not freq:
def setchannel(self, channel): if self.settings: frequency = get_frequency(channel, self.settings.chanlist) else: frequency = get_frequency(channel)
if not ((not item.filename or item.filename == '0') and \ item.mode in ('dvd', 'vcd') and item.player_rating >= 20):
if item.filename or (item.mode in ('dvd', 'vcd') and item.player_rating >= 20):
def get_items(item): next_start = 0 items = [] if not ((not item.filename or item.filename == '0') and \ item.mode in ('dvd', 'vcd') and item.player_rating >= 20): if item.info.has_key('audio') and len(item.info['audio']) > 1: items.append(menu.MenuItem(_('Audio selection'), audio_selection_menu, item)) if item.info....
cmd += ' >& %s/freevo_record_%s.log &' % (config.LOGDIR, int(time.time()))
cmd = self.cmd + ' >& %s/freevo_record_%s.log &' % (config.LOGDIR, int(time.time()))
def make_cmd(self): '''Build the command line for this recording.'''
cmd += ' >& /dev/null &'
cmd = self.cmd + ' >& /dev/null &'
def make_cmd(self): '''Build the command line for this recording.'''
popup = PopupBox(text='Fetching headlines...')
popup = PopupBox(text=_('Fetching headlines...'))
def fetchheadlinesfromurl(self): headlines = [] # create Reader object reader = Sax2.Reader()
items = [ ( self.create_locations_menu , 'Headlines Sites' ) ]
items = [ ( self.create_locations_menu , _('Headlines Sites' )) ]
def actions(self): """ return a list of actions for this item """ items = [ ( self.create_locations_menu , 'Headlines Sites' ) ] return items
if changed: p.clear()
def update(self): """ draw a background and all idlebar plugins """ screen = gui.get_display() changed = False
x, y = o.get_pos() o._idlebar_pos = x, y o.set_pos((x + x1, y + y1))
def update(self): """ draw a background and all idlebar plugins """ screen = gui.get_display() changed = False
o.set_pos((o.get_pos()[0] + x2 - width, o.get_pos()[1] + y1))
def update(self): """ draw a background and all idlebar plugins """ screen = gui.get_display() changed = False
self.__x = 0 self.__y = 0 self.width = 0
def __init__(self): plugin.Plugin.__init__(self) self._type = 'idlebar' self.objects = [] self.NO_CHANGE = -1 self.align = 'left'
else:
elif element.align == 'left':
def return_formatedtext( self, sel_list ): """ receives a list of indexex of elements to be used and returns a array with FormatText ready to print (with its elements x, y, width and height already calculated) """ x, y = 0, 0
else: element.width = r.width
def return_formatedtext( self, sel_list ): """ receives a list of indexex of elements to be used and returns a array with FormatText ready to print (with its elements x, y, width and height already calculated) """ x, y = 0, 0
if hasattr(settings,'menu'): if settings.menu.has_key(menu.item_types): area = settings.menu[menu.item_types] else: area = settings.menu['default'] if self.display_style['menu'] >= len(area.style): self.display_style['menu'] = 0 self.display_style['menu'] = (self.display_style['menu'] + 1) % len(area.style)
if settings.special_menu.has_key(menu.item_types): area = settings.special_menu[menu.item_types] else: area = settings.default_menu['default'] if self.display_style['menu'] >= len(area.style): self.display_style['menu'] = 0 self.display_style['menu'] = (self.display_style['menu'] + 1) % len(area.style)
def toggle_display_style(self, menu): """ Toggle display style """ if isinstance(menu, str): if not self.display_style.has_key(menu): self.display_style[menu] = 0 self.display_style[menu] = (self.display_style[menu] + 1) % \ len(self.settings.sets[menu].style) return 1 if menu.force_skin_layout != -1: return 0 if men...
'VOLUP' : MIXER_VOLUP, 'VOLDOWN' : MIXER_VOLDOWN,
'VOL+' : MIXER_VOLUP, 'VOL-' : MIXER_VOLDOWN,
def __cmp__(self, other): """ compare function, return 0 if the objects are identical, 1 otherwise """ if not other: return 1 if isinstance(other, Event): return self.name != other.name return self.name != other
if devname.lower().find('cdrom') != -1:
if devname.lower().find('cd') != -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
osdstring = [] if self.fileitem.binsdesc.has_key('title'): osdstring.append('Title: ' + self.fileitem.binsdesc['title']) elif self.fileitem.name: osdstring = [self.fileitem.name] else: osdstring = ['No Title'] if self.fileitem.binsdesc.has_key('description'): osdstring.append('Description: ' + self.fileitem.binsdesc...
if not self.fileitem.binsdesc.has_key('title'): osdstring = ["Title: " + self.fileitem.name] else: osdstring = [] tags_check = [['Title: ','NOTAG','title','BINS'], ['Description: ','NOTAG','description','BINS'] ]
def drawosd(self):
osdstring = ['No Exif info available'] f = open(self.filename, 'r') tags = exif.process_file(f) exif_tags = [ ['Date:','Image DateTime','DateTime',0], ['W:','EXIF ExifImageWidth','ExifImageWidth',0], ['H:','EXIF ExifImageLength','ExifImageLength',0], ['Exp:','EXIF ExposureTime','ExposureTime',1], ['F/','EXIF FNumbe...
osdstring = [] tags_check = [ ['Date:','Image DateTime','DateTime','EXIF'], ['W:','EXIF ExifImageWidth','ExifImageWidth','EXIF'], ['H:','EXIF ExifImageLength','ExifImageLength','EXIF'], ['Exp:','EXIF ExposureTime','ExposureTime','EXIF'], ['F/','EXIF FNumber','FNumber','EXIF'], ['FL:','EXIF FocalLength','FocalLength','E...
def drawosd(self):
osdstring = ['','','',''] for exiftag in exif_tags: line = exiftag[3] exifname = exiftag[1] binsname = exiftag[2] exiftitle = exiftag[0] exifstr='' if tags.has_key(exifname): exifstr = '%s %s' % (exiftitle,tags[exifname]) elif self.fileitem.binsexif.has_key(binsname): exifstr = '%s %s' % (exiftitle, self.fileitem.bins...
f = open(self.filename, 'r') tags = exif.process_file(f) for strtag in tags_check: exifname = strtag[1] binsname = strtag[2] exiftitle = strtag[0] priority = strtag[3] exifstr = '' binsstr = '' if tags.has_key(exifname): exifstr = '%s %s' % (exiftitle,tags[exifname]) if self.fileitem.binsexif.has_key(binsname): bi...
def drawosd(self):
osd.drawbox(0, osd.height - (25 + (len(osdstring) * 30)),
osd.drawbox(0, osd.height - (25 + (len(prt_line) * 30)),
def drawosd(self):
for line in range(len(osdstring)): h=osd.height - (50 + ( line * 30)) osd.drawstring(osdstring[line], 10, h, fgcolor=osd.COL_ORANGE)
for line in range(len(prt_line)): h=osd.height - (50 + ( (len(prt_line) - line - 1) * 30)) osd.drawstring(prt_line[line], 10, h, fgcolor=osd.COL_ORANGE)
def drawosd(self):
print item.type
def actions(self, item): if item.type == 'dir': diskfree = '%i of %i Mb free' % \ ( (( util.freespace(item.dir) / 1024) / 1024), ((util.totalspace(item.dir) /1024) /1024)) return [ ( self.dud, diskfree) ] else: print item.type return []
return True if event == 'AUDIO_ERROR_START_AGAIN': self.stop() self.play(self.options, self.item) return True if event == PLAY_END: self.stop() self.item.eventhandler(event)
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 """ mplayer.Application.eventhandler(self, event)
else: _debug_('MEDIA: Status=%s' % media.drive_status, 2)
def check_all(self): self.lock.acquire() for media in config.REMOVABLE_MEDIA: last_status = media.drive_status self.identify(media)
print pattern[i]
def __check_list(self, val, pattern): """ check parameter against pattern """ ret = [] for i in range(len(val)): print pattern[i] if pattern[i] == str: ret.append(unicode(val[i], 'UTF8').\ encode(sysconfig.ENCODING, 'replace')) elif pattern[i] == unicode: ret.append(unicode(val[i], 'UTF8')) elif pattern[i] == bool: pri...
print 'check', val[i]
def __check_list(self, val, pattern): """ check parameter against pattern """ ret = [] for i in range(len(val)): print pattern[i] if pattern[i] == str: ret.append(unicode(val[i], 'UTF8').\ encode(sysconfig.ENCODING, 'replace')) elif pattern[i] == unicode: ret.append(unicode(val[i], 'UTF8')) elif pattern[i] == bool: pri...
for i in p.get(self, [ self.current_item ]):
for i in p.get(self, l):
def play(self, arg=None, menuw=None): """ play the playlist """ if not self.menuw: self.menuw = menuw
if object == None: print "UPDATE BEGIN", self
def _update_begin(self, object = None): """ Called by a child 'object' when it wants to be updated. If 'object' is None, it means update() was called on the canvas itself. """
if object == None: print "UPDATE END", self
def _update_end(self, object = None): if object == None: print "UPDATE END", self self.thaw() return True
_debug_('RECORDSERVER GOT EVENT NOTICE')
def eventNotice(self): #print 'RECORDSERVER GOT EVENT NOTICE' # Use callLater so that handleEvents will get called the next time # through the main loop. reactor.callLater(0, self.handleEvents)
_debug_('RECORDSERVER HANDLING EVENT')
def handleEvents(self): #print 'RECORDSERVER HANDLING EVENT' event = rc_object.get_event()
_debug_('Handling event RECORD_START')
def handleEvents(self): #print 'RECORDSERVER HANDLING EVENT' event = rc_object.get_event()
_debug_('Handling event RECORD_STOP')
def handleEvents(self): #print 'RECORDSERVER HANDLING EVENT' event = rc_object.get_event()
pass
def handleEvents(self): #print 'RECORDSERVER HANDLING EVENT' event = rc_object.get_event()
app = Application("RecordServer")
def main(): app = Application("RecordServer") rs = RecordServer() if (config.DEBUG == 0): app.listenTCP(config.TV_RECORD_SERVER_PORT, server.Site(rs, logPath='/dev/null')) else: app.listenTCP(config.TV_RECORD_SERVER_PORT, server.Site(rs)) rs.startMinuteCheck() rc_object.subscribe(rs.eventNotice) app.run(save=0)
app.listenTCP(config.TV_RECORD_SERVER_PORT, server.Site(rs, logPath='/dev/null'))
reactor.listenTCP(config.TV_RECORD_SERVER_PORT, server.Site(rs, logPath='/dev/null'))
def main(): app = Application("RecordServer") rs = RecordServer() if (config.DEBUG == 0): app.listenTCP(config.TV_RECORD_SERVER_PORT, server.Site(rs, logPath='/dev/null')) else: app.listenTCP(config.TV_RECORD_SERVER_PORT, server.Site(rs)) rs.startMinuteCheck() rc_object.subscribe(rs.eventNotice) app.run(save=0)
app.listenTCP(config.TV_RECORD_SERVER_PORT, server.Site(rs))
reactor.listenTCP(config.TV_RECORD_SERVER_PORT, server.Site(rs))
def main(): app = Application("RecordServer") rs = RecordServer() if (config.DEBUG == 0): app.listenTCP(config.TV_RECORD_SERVER_PORT, server.Site(rs, logPath='/dev/null')) else: app.listenTCP(config.TV_RECORD_SERVER_PORT, server.Site(rs)) rs.startMinuteCheck() rc_object.subscribe(rs.eventNotice) app.run(save=0)
app.run(save=0)
reactor.run()
def main(): app = Application("RecordServer") rs = RecordServer() if (config.DEBUG == 0): app.listenTCP(config.TV_RECORD_SERVER_PORT, server.Site(rs, logPath='/dev/null')) else: app.listenTCP(config.TV_RECORD_SERVER_PORT, server.Site(rs)) rs.startMinuteCheck() rc_object.subscribe(rs.eventNotice) app.run(save=0)
import traceback
def main(): app = Application("RecordServer") rs = RecordServer() if (config.DEBUG == 0): app.listenTCP(config.TV_RECORD_SERVER_PORT, server.Site(rs, logPath='/dev/null')) else: app.listenTCP(config.TV_RECORD_SERVER_PORT, server.Site(rs)) rs.startMinuteCheck() rc_object.subscribe(rs.eventNotice) app.run(save=0)
if dirinfo['length'] != None:
if dirinfo['length'] != None and 0:
def check_info(dirinfo): """ Parse additional information recursive over the given listing. The function will try to find 'length', 'artist', 'album' and 'year'. """ listing = Listing(dirinfo.filename) if listing.num_changes: listing.update() # check if an update is needed for item in listing.get_dir(): if os.path.isl...
exec('%s = strcmp(dirinfo[type], %s)' % (type, type))
exec('%s = strcmp(item[type], %s)' % (type, type))
def check_info(dirinfo): """ Parse additional information recursive over the given listing. The function will try to find 'length', 'artist', 'album' and 'year'. """ listing = Listing(dirinfo.filename) if listing.num_changes: listing.update() # check if an update is needed for item in listing.get_dir(): if os.path.isl...
if eval(type):
if eval(type) not in ( '', VARIOUS ):
def check_info(dirinfo): """ Parse additional information recursive over the given listing. The function will try to find 'length', 'artist', 'album' and 'year'. """ listing = Listing(dirinfo.filename) if listing.num_changes: listing.update() # check if an update is needed for item in listing.get_dir(): if os.path.isl...
s1 = Unicode(s1) s2 = Unicode(s2)
if s1 != None: s1 = Unicode(s1) if s2 != None: s2 = Unicode(s2)
def strcmp(s1, s2): """ Compare the given strings. If one is empty, return the other. If both are equal, return the string. If they are different, return VARIOUS. """ s1 = Unicode(s1) s2 = Unicode(s2) if not s1 or not s2: return s1 or s2 if s1 == VARIOUS or s2 == VARIOUS: return VARIOUS if s1.replace(u' ', u'').lower...
return _('%s\nnot found!') % item.url
return _('%s\nnot found!') % Unicode(item.url)
def play(self, item, playerGUI): """ play a audioitem with mplayer """ self.playerGUI = playerGUI filename = item.filename
self.evt_context = 'video'
self.set_event_context('video')
def play(self, options, item): """ play a dvd with xine """ self.item = item self.evt_context = 'video' if config.EVENTS.has_key(item.mode): self.evt_context = item.mode
self.evt_context = item.mode
self.set_event_context(item.mode)
def play(self, options, item): """ play a dvd with xine """ self.item = item self.evt_context = 'video' if config.EVENTS.has_key(item.mode): self.evt_context = item.mode
self.evt_context = 'vcd'
self.set_event_context('vcd')
def play(self, options, item): """ play a dvd with xine """ self.item = item self.evt_context = 'video' if config.EVENTS.has_key(item.mode): self.evt_context = item.mode
print '%s: %s - %s' % (p.channel_id, p.title, time.strftime('%b %d ' + config.TV_TIMEFORMAT, time.localtime(p.start)))
print '%s:%d: %s - %s' % (String(p['channel_id']), p['id'], String(p['title']), time.strftime('%b %d ' + config.TV_TIMEFORMAT, time.localtime(p['start']))) def test_func(): epg.expire_programs() sys.exit(0)
def search_progs(subs): print 'Results:' print '--------' programs = epg.search_programs(subs) for p in programs: print '%s: %s - %s' % (p.channel_id, p.title, time.strftime('%b %d ' + config.TV_TIMEFORMAT, time.localtime(p.start)))
options = 'cfhilp:s:'
options = 'cfhilp:s:t'
def main(): update_chan = False show_info = False show_tables = False show_progs = False add_xmltv = False xmltv_file = '' search_subs = '' channel = '' options = 'cfhilp:s:' long_options = ['update-channels', 'fill', 'help', 'info', 'list', 'list-programs', 'search'] try: opts, args = getopt.getopt(sys.argv[1:], opt...
'list-programs', 'search']
'list-programs', 'search', 'test']
def main(): update_chan = False show_info = False show_tables = False show_progs = False add_xmltv = False xmltv_file = '' search_subs = '' channel = '' options = 'cfhilp:s:' long_options = ['update-channels', 'fill', 'help', 'info', 'list', 'list-programs', 'search'] try: opts, args = getopt.getopt(sys.argv[1:], opt...
if config.MOVIE_DATA_DIR: if dir.find(config.MOVIE_DATA_DIR) == 0: realdir = os.path.join('/', dir[len(config.MOVIE_DATA_DIR):]) if realdir.find('/disc/') == 0: realdir = realdir[6:] for c in config.REMOVABLE_MEDIA: if realdir.find(c.id) == 0: realdir = os.path.join(c.mountdir, realdir[len(c.id)+1:]) break else: realdi...
if config.MOVIE_DATA_DIR and dir.find(config.MOVIE_DATA_DIR) == 0: realdir = os.path.join('/', dir[len(config.MOVIE_DATA_DIR):]) if realdir.find('/disc/') == 0: realdir = realdir[6:] for c in config.REMOVABLE_MEDIA: if realdir.find(c.id) == 0: realdir = os.path.join(c.mountdir, realdir[len(c.id)+1:]) break else: realdi...
def parse_movie(node, file, parent, duplicate_check): """ parse the <movie> tag """ movies = [] # node == /freevo/items/movie video = {} variants = [] info = {} image = "" dir = os.path.dirname(file) # find the realdir in case this file is in MOVIE_DATA_DIR if config.MOVIE_DATA_DIR: if dir.find(config.MOVIE_DATA_DIR...
menuwidget.refresh(reload=1)
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 """
if event == rc.SELECT:
if event == rc.ENTER:
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 """