rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
def comingup(): return recordings.comingup
def add(self, prog): if not self.server: return False, 'Recordserver unavailable' try: if prog.channel == 'ANY': channel = [] for c in config.TV_CHANNELS: channel.append(c[0]) else: channel = [ prog.channel.id ] days = (_('Mon'), _('Tue'), _('Wed'), _('Thu'), _('Fri'), _('Sat'), _('Sun')) if prog.days in days: days = [...
r = self.get_item_rectangle(r, self.content.width - x, self.content.height - y )[ 2 ]
r = self.get_item_rectangle(r, self.content.width - x - shadow_x, self.content.height - y - shadow_y )[ 2 ]
def return_formatedtext( self, sel_list ): """ receives a list of indexex of elements to be used and returns a array with XML_FormatText ready to print (with its elements x, y, width and height already calculated) """ x, y = 0, 0 item = self.infoitem
m_width = size[ 2 ] - size[ 0 ] m_height = size[ 3 ] - size[ 1 ]
try: m_width = size[ 2 ] - size[ 0 ] m_height = size[ 3 ] - size[ 1 ] except: m_width = r.width m_height = r.height
def return_formatedtext( self, sel_list ): """ receives a list of indexex of elements to be used and returns a array with XML_FormatText ready to print (with its elements x, y, width and height already calculated) """ x, y = 0, 0 item = self.infoitem
search_string = '%s %s' % (artist,album)
search_string = '%s %s' % (String(artist), String(album))
def cover_search_file(self, arg=None, menuw=None): """ search imdb for this item """ box = PopupBox(text=_( 'searching Amazon...' ) ) box.show()
dict_tmp = { "artist": str(artist), "album": str(album) }
dict_tmp = { "artist": String(artist), "album": String(album) }
def cover_search_file(self, arg=None, menuw=None): """ search imdb for this item """ box = PopupBox(text=_( 'searching Amazon...' ) ) box.show()
print filename
def build(self, arg=None, menuw=None): """ build the items for the directory """ self.playlist = [] self.play_items = [] self.dir_items = [] self.pl_items = []
for entity in freevo.ipc.Instance().get_entities(None):
for entity in freevo.ipc.Instance().get_entities():
def check_mbus(self): """ Send a status request to all mbus entities to get the status. """ if not self.shutdown_counter: # looks like we came out of hibernate log.info('reset all shutdown timer') self.shutdown_counter = 6 self.timer.start(FIRST_START) self.timer.first_start = True return False
a.parameter(menwu=self.get_menustack(), arg=self.function[1])
a.parameter(menuw=self.get_menustack(), arg=self.function[1])
def actions(self): """ Actions for this item. """ a = Action(self.name, self.function[0]) a.parameter(menwu=self.get_menustack(), arg=self.function[1]) return [ a ]
if elem.children or elem.first_cdata:
if elem.children != [] or elem.first_cdata != None:
def _dump_recurse(self, f, elem, depth=0): """ Help function to dump all elements """ if not elem: return f.write('<' + elem.name) for (ns, name), value in elem.attrs.items(): f.write(u' ' + Unicode(name) + u'="' + Unicode(value) + '"') if elem.children or elem.first_cdata: if elem.first_cdata == None: f.write('>\n ')...
i = vfs.codecs_open( (self.fxdfile + '.fxd') , 'w', encoding='utf-8')
i = vfs.codecs_open( (self.fxdfile + '.fxd') , 'wb', encoding='utf-8')
def write_discset(self): """Write a <disc-set> to a fresh file""" try: i = vfs.codecs_open( (self.fxdfile + '.fxd') , 'w', encoding='utf-8') except IOError, error: raise FxdImdb_IO_Error("Writing FXD file failed : " + str(error)) return #header i.write("<?xml version=\"1.0\" ?>\n<freevo>\n") i.write(" <copyright>\n"...
s = unicode(line, config.LOCALE) while s[-1] == ' ':
s = Unicode(line) while s[-1] == u' ':
def str2XML(self, line): """return a valid XML string""" try: s = unicode(line, config.LOCALE) while s[-1] == ' ': s = s[:-1] if s[:4] == '&#34': s = s[5:] if s[-4:] == '#34;': s = s[:-5] # replace all & to &amp; ... s = s.replace("&", "&amp;")
if s[:4] == '&
if s[:4] == u'&
def str2XML(self, line): """return a valid XML string""" try: s = unicode(line, config.LOCALE) while s[-1] == ' ': s = s[:-1] if s[:4] == '&#34': s = s[5:] if s[-4:] == '#34;': s = s[:-5] # replace all & to &amp; ... s = s.replace("&", "&amp;")
if s[-4:] == '
if s[-4:] == u'
def str2XML(self, line): """return a valid XML string""" try: s = unicode(line, config.LOCALE) while s[-1] == ' ': s = s[:-1] if s[:4] == '&#34': s = s[5:] if s[-4:] == '#34;': s = s[:-5] # replace all & to &amp; ... s = s.replace("&", "&amp;")
s = s.replace("&", "&amp;")
s = s.replace(u"&", u"&amp;")
def str2XML(self, line): """return a valid XML string""" try: s = unicode(line, config.LOCALE) while s[-1] == ' ': s = s[:-1] if s[:4] == '&#34': s = s[5:] if s[-4:] == '#34;': s = s[:-5] # replace all & to &amp; ... s = s.replace("&", "&amp;")
s = s.replace("&amp;
s = s.replace(u"&amp;
def str2XML(self, line): """return a valid XML string""" try: s = unicode(line, config.LOCALE) while s[-1] == ' ': s = s[:-1] if s[:4] == '&#34': s = s[5:] if s[-4:] == '#34;': s = s[:-5] # replace all & to &amp; ... s = s.replace("&", "&amp;")
return line
return Unicode(line)
def str2XML(self, line): """return a valid XML string""" try: s = unicode(line, config.LOCALE) while s[-1] == ' ': s = s[:-1] if s[:4] == '&#34': s = s[5:] if s[-4:] == '#34;': s = s[:-5] # replace all & to &amp; ... s = s.replace("&", "&amp;")
ret = ''
ret = u''
def print_info(self): """return info part for FXD writing""" ret = '' if self.info: ret = ' <info>\n' for k in self.info.keys(): ret += ' <%s>%s</%s>\n' % (k, self.info[k], k) ret += ' </info>\n' return ret
ret = ' <info>\n'
ret = u' <info>\n'
def print_info(self): """return info part for FXD writing""" ret = '' if self.info: ret = ' <info>\n' for k in self.info.keys(): ret += ' <%s>%s</%s>\n' % (k, self.info[k], k) ret += ' </info>\n' return ret
ret += ' <%s>%s</%s>\n' % (k, self.info[k], k) ret += ' </info>\n'
ret += u' <%s>' % k + Unicode(self.info[k]) + '</%s>\n' % k ret += u' </info>\n'
def print_info(self): """return info part for FXD writing""" ret = '' if self.info: ret = ' <info>\n' for k in self.info.keys(): ret += ' <%s>%s</%s>\n' % (k, self.info[k], k) ret += ' </info>\n' return ret
if self.item.getattr('artist') and self.item.getattr('album'):
if self.item.getattr('artist') and \ ((self.item.getattr('album') and item.type == 'audio') or \ (self.item.getattr('title') and item.type == 'audiocd')):
def actions(self, item): self.item = item if item.type == 'audio' or item.type == 'audiocd': try: if self.item.getattr('artist') and self.item.getattr('album'): return [ ( self.cover_search_file, 'Find a cover for this music', 'imdb_search_or_cover_search') ] except KeyError: pass return []
album = self.item.info['album']
if self.item.type == 'audio': album = self.item.info['album'] else: album = self.item.info['title']
def cover_search_file(self, arg=None, menuw=None): """ search imdb for this item """ import amazon
if len(files) > 20:
if (len(files) > 20) and not (dirnames and config.RECURSIVE_PLAYLIST):
def parse_entry(arg=None, menuw=None): """ The music module change directory handling function formerly known as cwd Arguments: Array of arguments - Since that's the way it is done. Todo: Should do a test on dir to see if it is a playlist I open for it in main_menu, but it shouldn't be a problem. Got crash on pla...
for file in files: a = AudioInfo(file)
for fname in files: if DEBUG: print 'music: getting info for "%s"' % fname a = AudioInfo(fname)
def parse_entry(arg=None, menuw=None): """ The music module change directory handling function formerly known as cwd Arguments: Array of arguments - Since that's the way it is done. Todo: Should do a test on dir to see if it is a playlist I open for it in main_menu, but it shouldn't be a problem. Got crash on pla...
f = open('freevo.pot', 'a')
f = open('i18n/freevo.pot', 'a')
def i18n(application): """ i18n cmd support """ global use_i18n use_i18n = 1 # cmd == '18n' if len(sys.argv) > 1 and sys.argv[1].lower() == 'i18n': if len(sys.argv) > 2 and sys.argv[2].lower() == '--help': print 'Updates the i18n translation. This includes generating the pot' print 'file, merging the pot file into the...
(gui.width, gui.height))
(gui.width, gui.height), config.IMAGEVIEWER_BLEND_MODE)
def view(self, item, zoom=0, rotation=0): """ Show the image """ if zoom: self.set_eventmap('image_zoom') else: self.set_eventmap('image')
print 'RECORDSERVER GOT EVENT NOTICE'
def eventNotice(self): print 'RECORDSERVER GOT EVENT NOTICE'
print 'RECORDSERVER HANDLING EVENT'
def handleEvents(self): print 'RECORDSERVER HANDLING EVENT'
print 'Handling event RECORD_START'
def handleEvents(self): print 'RECORDSERVER HANDLING EVENT'
print 'Handling event RECORD_STOP'
def handleEvents(self): print 'RECORDSERVER HANDLING EVENT'
url = 'http://us.imdb.com/Posters?%s' % id
url = 'http://us.imdb.com/title/tt%s/posters' % id
def parsedata(self, results, id=0): """results (imdb html page), imdb_id Returns tuple of (title, info(dict), image_urls)"""
for line in r.read().split("\n"):
data = r.read().replace('</a>', '\n').replace('</A>', '\n') for line in data.split('\n'):
def parsedata(self, results, id=0): """results (imdb html page), imdb_id Returns tuple of (title, info(dict), image_urls)"""
if item.type == 'dir' or item.type == 'playlist': return items
def actions(self, item): self.item = item items = [] ab = self.__get_auto_bookmark__(item) if ab: items.append((self.resume, 'Resume playback')) if item.mode == 'file' and not item.variants and \ not item.subitems and os.path.exists(util.get_bookmarkfile(item.filename)): items.append(( self.bookmark_menu, 'Bookmarks')...
osd.drawroundbox(0, 0, osd.width + 2 * osd.x, osd.y + 60, (0x80000000, 0, 0, 0))
osd.drawroundbox(0, 0, osd.width + 2 * osd.x, osd.y + 60, (0x80000000L, 0, 0, 0))
def draw(self, (type, object), osd): """ draw a background and all idlebar plugins """ osd.drawroundbox(0, 0, osd.width + 2 * osd.x, osd.y + 60, (0x80000000, 0, 0, 0)) if not self.plugins: self.plugins = plugin.get('idlebar') x = osd.x + 10 for p in self.plugins: add_x = p.draw((type, object), x, osd) if add_x: x += ad...
for x0, y0, x1, y1 in self.updatelist['background']: self.s_bg.blit(o[1], (x0, y0), (x0-o[2], y0-o[3], x1-x0, y1-y0))
self.s_bg.blit(o[1], o[2:])
def show(self, force_redraw=FALSE): """ the main drawing function """
print 'or with the subject \'[Freevo-Bugreport\] GUI\' to'
print 'or with the subject \'[Freevo-Bugreport] GUI\' to'
def get_surface(self): """ get a subsurface from the parent to draw in """ try: return self.parent.surface.subsurface(self.get_rect()) except Exception, e: print '******************************************************************' print 'Exception: %s' % e print 'Please report the following lines to the freevo mailing ...
print 'wanted %s for %s' % (self.get_rect(), self.parent.surface)
if not self.parent: print 'object has no parent:' print self elif not hasattr(self.parent, 'surface'): print 'parent has no surface:' print self, self.parent elif not self.parent.surface: print 'parent surface is None:' print self, self.parent else: print 'wanted %s for %s' % (self.get_rect(), self.parent.surface)
def get_surface(self): """ get a subsurface from the parent to draw in """ try: return self.parent.surface.subsurface(self.get_rect()) except Exception, e: print '******************************************************************' print 'Exception: %s' % e print 'Please report the following lines to the freevo mailing ...
if item.deinterlace:
if self.version >= 1 and item.deinterlace: additional_args += [ '-vf', 'pp=de/fd' ] elif item.deinterlace:
def play(self, options, item): """ play a videoitem with mplayer """ self.parameter = (options, item) mode = item.mode network_play = item.network_play url = item.url self.item = item
elif self.version >= 1: additional_args += [ '-vf', 'pp=de' ]
def play(self, options, item): """ play a videoitem with mplayer """ self.parameter = (options, item) mode = item.mode network_play = item.network_play url = item.url self.item = item
o.set_pos((o.get_pos()[0] + x1, o.get_pos()[1] + y1))
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
_debug_( "Could not convert %s to unicode using \"%s\" encoding: %s" % \ ( repr(string), encoding, e ))
try: return unicode(string, config.LOCALE) except Exception, e: print 'Error: Could not convert %s to unicode' % repr(string) print 'tried encoding %s and %s' % (encoding, config.LOCALE) print e
def Unicode(string, encoding=config.encoding): if type(string) == str: try: return unicode(string, encoding) except Exception, e: _debug_( "Could not convert %s to unicode using \"%s\" encoding: %s" % \ ( repr(string), encoding, e )) return string
if not self.child: _debug_('already dead', 2)
if hasattr(self,'child'): if not self.child: _debug_('already dead', 2) return else: _debug_('This should never happen!',1)
def kill(self, signal=15): global __all_childapps__
if self.selected.scheduled: program_display.ProgramDisplay(parent=self, context='recording', prog=self.selected).show() else: program_display.ProgramDisplay(parent=self, prog=self.selected).show()
self.event_RECORD() self.menuw.refresh()
def eventhandler(self, event): _debug_('TVGUIDE EVENT is %s' % event, 2)
if os.path.exists(tvlockfile):
now = time.time() + (7*60) if self.selected.start > now: self.event_RECORD() elif os.path.exists(tvlockfile):
def eventhandler(self, event): _debug_('TVGUIDE EVENT is %s' % event, 2)
self.hide() self.player('tv', self.selected.channel_id)
else: self.hide() self.player('tv', self.selected.channel_id)
def eventhandler(self, event): _debug_('TVGUIDE EVENT is %s' % event, 2)
ConfirmBox(text='Do you wish to delete %s?' % self.name,
ConfirmBox(text='Do you wish to delete\n %s?' % self.name,
def confirm_delete(self, arg=None, menuw=None): if not self.menuw: self.menuw = menuw ConfirmBox(text='Do you wish to delete %s?' % self.name, handler=self.delete_file, default_choice=1).show()
cmd += ' -cdrom-device %s -dvd-device %s' % \ (self.media.devicename, self.media.devicename)
if self.media: cmd += ' -cdrom-device %s -dvd-device %s' % \ (self.media.devicename, self.media.devicename)
def dvd_vcd_title_menu(self, arg=None, menuw=None): """ Generate special menu for DVD/VCD/SVCD content """ pop = None
cmd += ' -cdrom-device %s -dvd-device %s' % \ (self.media.devicename, self.media.devicename)
if self.media: cmd += ' -cdrom-device %s -dvd-device %s' % \ (self.media.devicename, self.media.devicename)
def settings(self, arg=None, menuw=None): if not self.menuw: self.menuw = menuw pop = None if not self.scanned: self.scanned = TRUE # Use the uid to make a user-unique filename uid = os.getuid()
for child in self.children: child.draw()
def refresh(self, reload=0): menu = self.menustack[-1]
elif event == INPUT_QUIT:
elif event == INPUT_EXIT:
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 """
MainMenuItem.__init__(self, parent, skin_type='shutdown')
MainMenuItem.__init__(self, parent=parent, skin_type='shutdown')
def __init__(self, parent=None): MainMenuItem.__init__(self, parent, skin_type='shutdown') self.menuw = None
continue
pass
def __init__(self, number): self.adapter = '/dev/dvb/adapter' + number _debug_('register dvb device %s' % self.adapter) INFO_ST = '128s10i' val = ioctl.pack( INFO_ST, "", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) devfd = os.open(self.adapter + '/frontend0', os.O_TRUNC) r = ioctl.ioctl(devfd, ioctl.IOR('o', 61, INFO_ST), val) os.c...
def __init__(self, from_dir, to_dir):
def __init__(self, from_dir, to_dir, recursive=False, makedirs=False):
def __init__(self, from_dir, to_dir): plugin.ItemPlugin.__init__(self) self.from_dir = from_dir self.to_dir = to_dir
if item.type == 'video' and item.mode == 'file' and \ item.parent.type == 'dir' and item.parent.dir == self.from_dir:
if ( item.type == 'video' and item.mode == 'file' and item.parent.type == 'dir' and self.to_dir != os.path.dirname(self.item.filename) and ( ( self.recursive and os.path.commonprefix( ( item.parent.dir, self.from_dir)) == self.from_dir ) or ( item.parent.dir == self.from_dir))):
def actions(self, item): self.item = item if item.type == 'video' and item.mode == 'file' and \ item.parent.type == 'dir' and item.parent.dir == self.from_dir: return [ (self.mover_to_series, _('Move to [%s]') % os.path.basename(self.to_dir)) ] return []
childapp.Application.stop(self)
base.Application.stop(self)
def eventhandler(self, event): """ Eventhandler function. """ if event == PLAY_END: childapp.Application.stop(self) return False
name = self.item.filename name = item.label
name = item.media.label
def imdb_get_disc_searchstring(self, item): name = self.item.filename name = item.label name = re.sub('([a-z])([A-Z])', point_maker, name) name = re.sub('([a-zA-Z])([0-9])', point_maker, name) name = re.sub('([0-9])([a-zA-Z])', point_maker, name.lower())
WATCH_TV_APP = '/bin/echo'
WATCH_TV_APP = './matrox_g400/v4l1_to_mga'
def ConfigInit(videotools = 'sim'): print 'VIDEOTOOLS = %s' % videotools global MPLAYER_CMD, MPLAYER_ARGS_MPG, MPLAYER_ARGS_DVD, MPLAYER_ARGS_DVDNAV, VIDREC_MQ, VIDREC_HQ if videotools == 'real': MPLAYER_CMD = '/usr/local/bin/mplayer' MPLAYER_ARGS_MPG = '-nolirc -nobps -idx -framedrop -cache 10000 -vo mga -screenw 76...
_debug_('Couldnt load font "%s"' % filename)
_debug_('Couldnt load font "%s"' % os.path.basename(filename).lower())
def __getfont__(self, filename, ptsize): ptsize = int(ptsize / 0.7) # XXX pygame multiplies by 0.7 for some reason
_debug_('trying alternate: %s' % alt_fname)
_debug_('trying alternate: %s' % os.path.basename(alt_fname).lower())
def __getfont__(self, filename, ptsize): ptsize = int(ptsize / 0.7) # XXX pygame multiplies by 0.7 for some reason
notifier.addTimer(2000, self.poll)
kaa.notifier.addTimer(2000, self.poll)
def __init__(self): self.rebuild_file = sysconfig.cachefile('freevo-rebuild-database')
print "osd.drawstringframed_soft():\n\n%s\n" % lines
if DEBUG >= 3: print "osd.drawstringframed_soft():\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='...'):
self.selected_pos = self.choices.index(item) self.selected_id = self.selected.__id__()
try: self.selected_pos = self.choices.index(item) self.selected_id = self.selected.__id__() except ValueError, e: log.exception('crash by select %s in %s' (item, self.choices)) if self.choices: self.select(self.choices[0]) else: self.select(None)
def select(self, item): """ Set the selection to a specific item in the list. If item in an int select a new item relative to current selected """ if isinstance(item, Item): # select item self.selected = item self.selected_pos = self.choices.index(item) self.selected_id = self.selected.__id__() elif item == None: ...
media.info = None
def cwd(self, arg=None, menuw=None): """ make a menu item for each file in the directory """ # Problems with disc id: # [2114541066, 10, 150, 17220, 36170, 54412, 68800, 91162, 112110, 129230, 141320, 165100, 2392] # Returns multiple results (query_stat, query_info) = CDDB.query(self.disc_id) if query_stat == 200: pri...
def __init__(self, zone='CYYZ'): IdleBarPlugin.__init__(self)
def __init__(self, zone='CYYZ', units='C'): IdleBarPlugin.__init__(self) self.TEMPUNITS = units
def __init__(self, zone='CYYZ'): IdleBarPlugin.__init__(self) self.METARCODE = zone self.WEATHERCACHE = config.FREEVO_CACHEDIR + '/weather' self.CLOCKFONT = 'skins/fonts/Trebuchet_MS.ttf' if not os.path.isfile(self.CLOCKFONT): # XXX Get this from the skin, but for now this will allow it to work self.CLOCKFONT = config....
temperature = '%2d' % weather.getTemperatureCelsius()
if self.TEMPUNITS == 'F': ctemp = weather.getTemperatureCelsius() ftemp = ((ctemp + 40) * 9 / 5) - 40 temperature = '%2d' % ftemp elif self.TEMPUNITS == 'K': ktemp = weather.getTemperatureCelsius() + 273 temperature = '%3d' % ktemp else: temperature = '%2d' % weather.getTemperatureCelsius()
def checkweather(self): # We don't want to do this every 30 seconds, so we need # to cache the date somewhere. # # First check the age of the cache. # if (os.path.isfile(self.WEATHERCACHE) == 0 or \ (abs(time.time() - os.path.getmtime(self.WEATHERCACHE)) > 3600)): weather = pymetar.MetarReport() try: weather.fetchMetar...
info.url = info['mime'][6:] + '://' if info['mime'] in ('video/vcd', 'video/dvd'): return info
def disc_info(media): """ Return information for the media """ type, id = cdrom_disc_id(media.devicename) if not id: # bad disc, e.g. blank disc return DiscInfo(False, media) cachefile = os.path.join(sysconfig.VFS_DIR, 'disc/metadata/%s.db' % id) cache = FileCache(media.devicename, cachefile) info = DiscInfo(True, med...
self.write_text(prg.title, font, content, x=tx0+ig.x, y=ty0+ig.y, width=ig.width, height=-1,
pad_x0 = flag_right * rightarrow_size[0] pad_x1 = flag_left * leftarrow_size[0] self.write_text(prg.title, font, content, x=tx0+ig.x + pad_x0, y=ty0+ig.y, width=ig.width - pad_x0 - pad_x1, height=-1,
def update_content(self): """ update the listing area """
key += os.stat(url)[stat.ST_MTIME]
key += str(os.stat(url)[stat.ST_MTIME])
def load(url, size=None, cache=False, vfs_save=False): """ Load a bitmap and return the image object. If width and height are given, the image is scaled to that. Setting only width or height will keep aspect ratio. If vfs_save is true, the so scaled bitmap will be stored in the vfs for future use. """ if size == None: ...
print "in actions\n"
def actions(self): print "in actions\n" return [ ( self.create_apod_menu , 'APOD Pictures' ) ]
print "in create menu\n"
def create_apod_menu(self, arg=None, menuw=None): print "in create menu\n" apodmenuitems = []
mntdir = match_cd.group(2) devname = match_cd.group(1)
mntdir = match_cdrec.group(2) devname = match_cdrec.group(1)
def read_config(filename, conf): if DEBUG: print 'Reading config file %s' % filename lines = open(filename).readlines() for line in lines: vals = line.strip().split() if DEBUG: print 'Cfg file data: "%s"' % line.strip() try: name, val = vals[0], vals[2] except: print 'Error parsing config file data "%s"' % line.strip(...
mntdir = match_iso.group(1) devname = match_iso.group(2)
mntdir = match_automount.group(1) devname = match_automount.group(2)
def read_config(filename, conf): if DEBUG: print 'Reading config file %s' % filename lines = open(filename).readlines() for line in lines: vals = line.strip().split() if DEBUG: print 'Cfg file data: "%s"' % line.strip() try: name, val = vals[0], vals[2] except: print 'Error parsing config file data "%s"' % line.strip(...
items.append(prog) cmenu = menu.Menu(self.channel.name, items)
if not prog.id == -1: items.append(ProgramItem(prog)) notifier_counter = (notifier_counter + 1) % 500 if not notifier_counter: notifier.step(False, False) cmenu = menu.Menu(self.channel.name, items, item_types = 'tv program menu')
def channel_details(self, arg=None, menuw=None): items = [] for prog in self.channel.get(time.time(), -1): items.append(prog) cmenu = menu.Menu(self.channel.name, items) # FIXME: the percent values need to be calculated # cmenu.table = (15, 15, 70) menuw.pushmenu(cmenu)
print('Recorder::Record: %s' % rec_prog)
if DEBUG: print('Recorder::Record: %s' % rec_prog)
def Record(self, rec_prog):
print('Record_Thread::run: mode=%s' % self.mode)
if DEBUG: print('Record_Thread::run: mode=%s' % self.mode)
def run(self): while 1: print('Record_Thread::run: mode=%s' % self.mode) if self.mode == 'idle': self.mode_flag.wait() self.mode_flag.clear() elif self.mode == 'record': print 'Record_Thread::run: started recording'
print 'Record_Thread::run: started recording'
if DEBUG: print 'Record_Thread::run: started recording'
def run(self): while 1: print('Record_Thread::run: mode=%s' % self.mode) if self.mode == 'idle': self.mode_flag.wait() self.mode_flag.clear() elif self.mode == 'record': print 'Record_Thread::run: started recording'
print 'CHAN: %s' % fc.getChannel()
if DEBUG: print 'CHAN: %s' % fc.getChannel()
def run(self): while 1: print('Record_Thread::run: mode=%s' % self.mode) if self.mode == 'idle': self.mode_flag.wait() self.mode_flag.clear() elif self.mode == 'record': print 'Record_Thread::run: started recording'
print 'Setting Input to %s' % vg.input_num
if DEBUG: print 'Setting Input to %s' % vg.input_num
def run(self): while 1: print('Record_Thread::run: mode=%s' % self.mode) if self.mode == 'idle': self.mode_flag.wait() self.mode_flag.clear() elif self.mode == 'record': print 'Record_Thread::run: started recording'
print 'Setting Channel to %s' % self.prog.tunerid
if DEBUG: print 'Setting Channel to %s' % self.prog.tunerid
def run(self): while 1: print('Record_Thread::run: mode=%s' % self.mode) if self.mode == 'idle': self.mode_flag.wait() self.mode_flag.clear() elif self.mode == 'record': print 'Record_Thread::run: started recording'
print('Record_Thread::run: finished recording')
if DEBUG: print('Record_Thread::run: finished recording')
def run(self): while 1: print('Record_Thread::run: mode=%s' % self.mode) if self.mode == 'idle': self.mode_flag.wait() self.mode_flag.clear() elif self.mode == 'record': print 'Record_Thread::run: started recording'
self.drawstring(text, content.font, content, height=-1, mode='hard')
self.drawstring(text, content.font, content, mode='hard')
def update_content(self): """ update the content """ menu = self.menu layout = self.layout area = self.area_val content = self.calc_geometry(layout.content, copy_object=True)
close(fd)
fd.close()
def readfile(filename): fd = open(str(filename), 'r') ret = fd.readlines() close(fd) return ret
self.thread.mode = 'record' self.thread.prog = rec_prog self.thread.command = self.rec_command
if config.VCR_CMD.find('%(filename)s') > 0: ext = config.VCR_CMD[config.VCR_CMD.find('%(filename)s')+12:] for bad_char in (' ', '"', '\''): if ext.find(bad_char) > 0: ext = ext[:ext.find(bad_char)] print ext if ext.startswith('.') and len(ext) < 5: rec_prog.filename += ext self.thread.mode = 'record' self.thread.p...
def Record(self, rec_prog): frequency = self.fc.chanSet(str(rec_prog.tunerid), 'record plugin')
if self.autokill <= 0: if DEBUG: print 'autokill timeout, stopping recording' self.mode = 'stop'
def run(self): while 1: if DEBUG: print('Record_Thread::run: mode=%s' % self.mode) if self.mode == 'idle': self.mode_flag.wait() self.mode_flag.clear() elif self.mode == 'record': rc.post_event(Event('RECORD_START', arg=self.prog)) if DEBUG: print('Record_Thread::run: cmd=%s' % self.command)
print uri
def add_uri(channel, uri): """ Add a URI to the internal list where to find that channel. Also save the access_id because many people, mostly North Americans, like to use it (usually in the display). """ if uri.find(':') == -1: channel.access_id = uri defaults = [] if isinstance(config.TV_DEFAULT_DEVICE, list) or \ isi...
self.xml_file = None if parent and hasattr(self.parent, 'xml_file'):
if parent and hasattr(self.parent, 'xml_file') and not self.xml_file:
def __init__(self, filename, parent): Item.__init__(self, parent)
def add_channel(self, id, call_sign, tuner_id): query = 'insert or replace into channels (id, call_sign, tuner_id) \ values ("%s", "%s", "%s")' % (id, call_sign, tuner_id)
def add_channel(self, id, display_name, access_id): query = 'insert or replace into channels (id, display_name, access_id) \ values ("%s", "%s", "%s")' % (id, display_name, access_id)
def add_channel(self, id, call_sign, tuner_id): query = 'insert or replace into channels (id, call_sign, tuner_id) \ values ("%s", "%s", "%s")' % (id, call_sign, tuner_id)
query = 'select * from channels'
query = 'select * from channels order by access_id'
def get_channels(self): query = 'select * from channels'
if old_prog['title'] == title:
if Unicode(old_prog['title']) == Unicode(title):
def add_program(self, channel_id, title, start, stop, subtitle='', description='', episode=''): now = time.time() title = escape_value(title) subtitle = escape_value(subtitle) description = escape_value(description) # print 'DESC: %s' % description episode = escape_value(episode)
print 'REMOVE: %s' % escape_query(query) self.execute(query)
self.execute(query) query = 'delete from program_category where program_id=%d' % id self.execute(query) query = 'delete from program_advisory where program_id=%d' % id self.execute(query) query = 'delete from record_programs where program_id=%d' % id self.execute(query) query = 'delete from recorded_programs where ...
def remove_program(self, id): query = 'delete from programs where id=%d' % id
query = 'delete from programs where'
clause = ''
def remove_programs(self, ids): query = 'delete from programs where' for id in ids: query = '%s id=%d' % id if ids.index(id) < len(ids)-1: query = '%s or' % query
query = '%s id=%d' % id
clause += ' id=%d' % id
def remove_programs(self, ids): query = 'delete from programs where' for id in ids: query = '%s id=%d' % id if ids.index(id) < len(ids)-1: query = '%s or' % query
query = '%s or' % query print 'REMOVE: %s' % escape_query(query)
clause += ' or' query = 'delete from programs where %s' % clause self.execute(query) clause = '' for id in ids: clause += ' program_id=%d' % id if ids.index(id) < len(ids)-1: clause += ' or' query = 'delete from program_category where %s' % clause self.execute(query) query = 'delete from program_advisory where %s...
def remove_programs(self, ids): query = 'delete from programs where' for id in ids: query = '%s id=%d' % id if ids.index(id) < len(ids)-1: query = '%s or' % query
def add_data_xmltv(self, xmltv_file, verbose=1):
def add_data_xmltv(self, xmltv_file, exclude_channels=None, verbose=1):
def search_programs(self, subs, by_chan=None): now = time.time() clause = 'where stop > %d' % now if by_chan: clause = '%s and channel_id="%s"' % (clause, by_chan)
xmltv.load_guide(self, xmltv_file, verbose=verbose)
xmltv.load_guide(self, xmltv_file, exclude_channels, verbose) self.expire_programs()
def add_data_xmltv(self, xmltv_file, verbose=1): import xmltv xmltv.load_guide(self, xmltv_file, verbose=verbose)
def add_data_vdr(self, epg_file=None, host=None, port=None):
def add_data_vdr(self, vdr_dir=None, channels_file=None, epg_file=None, host=None, port=None, access_by='sid', exclude_channels=None, verbose=1):
def add_data_vdr(self, epg_file=None, host=None, port=None): try: import vdr.vdr except: print 'vdrpylib is not installed:' print 'http://sourceforge.net/projects/vdrpylib/'
print 'pyepg epgfile1 is %s' % epg_file if os.path.isfile(epg_file): (vdr_dir, epg_file) = os.path.split(epg_file) vdr = vdr.vdr.VDR(epgfile=epg_file, videopath=vdr_dir) print 'pyepg epgfile is %s' % vdr.epgfile epg = vdr.readepg() chans = vdr.channels.values() for c in chans: print 'Adding channel: %s' % c.id self.ad...
if not (isinstance(exclude_channels, list) or \ isinstance(exclude_channels, tuple)): exclude_channels = [] print 'excluding channels: %s' % exclude_channels vdr = vdr.vdr.VDR(host=host, port=port, videopath=vdr_dir, channelsfile=channels_file, epgfile=epg_file, close_connection=0) if vdr.epgfile and os.path.isfile(...
def add_data_vdr(self, epg_file=None, host=None, port=None): try: import vdr.vdr except: print 'vdrpylib is not installed:' print 'http://sourceforge.net/projects/vdrpylib/'
chans = vdr.channels.values() for c in chans: if c.id in exclude_channels: continue if access_by == 'name': access_id = c.name elif access_by == 'rid': access_id = c.rid else: access_id = c.sid if verbose: print 'Adding channel: %s as %s' % (c.id, access_id) self.add_channel(c.id, c.name, access_id) for e in c.event...
def add_data_vdr(self, epg_file=None, host=None, port=None): try: import vdr.vdr except: print 'vdrpylib is not installed:' print 'http://sourceforge.net/projects/vdrpylib/'
print 'has'
def __init__(self, heading, choices, xml_file=None, packrows=1, umount_all = 0, reload_func = None, item_types = None, force_skin_layout = -1): # XXX Add a list of eventhandlers? self.heading = heading self.choices = choices # List of MenuItem:s if len(self.choices): self.selected = self.choices[0] else: self....
fd.close()
os.close(fd)
def identify(self, media):
pass
self.__child = None if hasattr(self, 'item') and self.item: PLAY_END.post(self.item)
def child_finished(self): """ Callback when the child is finished. Override this method to react when the child is finished. """ pass