rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
mixer.setLineinVolume(90)
mixer.setLineinVolume( config.TV_IN_VOLUME ) mixer.setIgainVolume( config.TV_IN_VOLUME )
def Play(self, mode, tuner_channel=None):
mixer.setPcmVolume(100) mixer.setLineinVolume(0) mixer.setMicVolume(0)
if config.MAJOR_AUDIO_CTRL == 'VOL': mixer.setPcmVolume( config.MAX_VOLUME ) elif config.MAJOR_AUDIO_CTRL == 'PCM': mixer.setMainVolume( config.MAX_VOLUME ) mixer.setLineinVolume( 0 ) mixer.setMicVolume( 0 ) mixer.setIgainVolume( 0 )
def Stop(self): mixer.setPcmVolume(100) mixer.setLineinVolume(0) mixer.setMicVolume(0)
tuner_channel = self.TunerGetChannel() mixer.setLineinVolume(0) self.thread.app.write(config.TV_SETTINGS + ' ' + tuner_channel + '\n') time.sleep(0.1) mixer.setLineinVolume(90)
self.channel_change_do_stuff()
def EventHandler(self, event): print '%s app got %s event' % (self.mode, event) if event == rc.MENU or event == rc.STOP or event == rc.SELECT or event == rc.PLAY_END: self.Stop() rc.app = None menuwidget.refresh() elif event == rc.CHUP: if self.mode == 'vcr': return # Go to the next channel in the list self.TunerNextCh...
mixer.setLineinVolume(0) tuner_channel = self.TunerGetChannel() self.thread.app.write(config.TV_SETTINGS + ' ' + tuner_channel + '\n')
self.channel_change_do_stuff() elif event == rc.LEFT: if self.mode == 'vcr': return mixer.setLineinVolume( 0 ) mixer.setIgainVolume( 0 ) self.thread.app.write( config.TV_SETTINGS + ' ' + 'fine_minus' + '\n' )
def EventHandler(self, event): print '%s app got %s event' % (self.mode, event) if event == rc.MENU or event == rc.STOP or event == rc.SELECT or event == rc.PLAY_END: self.Stop() rc.app = None menuwidget.refresh() elif event == rc.CHUP: if self.mode == 'vcr': return # Go to the next channel in the list self.TunerNextCh...
mixer.setLineinVolume(90) elif event == rc.LEFT:
mixer.setLineinVolume( config.TV_IN_VOLUME ) mixer.setIgainVolume( config.TV_IN_VOLUME ) elif event == rc.RIGHT:
def EventHandler(self, event): print '%s app got %s event' % (self.mode, event) if event == rc.MENU or event == rc.STOP or event == rc.SELECT or event == rc.PLAY_END: self.Stop() rc.app = None menuwidget.refresh() elif event == rc.CHUP: if self.mode == 'vcr': return # Go to the next channel in the list self.TunerNextCh...
mixer.setLineinVolume(0) self.thread.app.write(config.TV_SETTINGS + ' ' + 'fine_minus' + '\n')
mixer.setLineinVolume( 0 ) mixer.setIgainVolume( 0 ) self.thread.app.write( config.TV_SETTINGS + ' ' + 'fine_plus' + '\n' )
def EventHandler(self, event): print '%s app got %s event' % (self.mode, event) if event == rc.MENU or event == rc.STOP or event == rc.SELECT or event == rc.PLAY_END: self.Stop() rc.app = None menuwidget.refresh() elif event == rc.CHUP: if self.mode == 'vcr': return # Go to the next channel in the list self.TunerNextCh...
mixer.setLineinVolume(90) elif event == rc.RIGHT: if self.mode == 'vcr': return mixer.setLineinVolume(0) self.thread.app.write(config.TV_SETTINGS + ' ' + 'fine_plus' + '\n') time.sleep(0.1) mixer.setLineinVolume(90)
mixer.setLineinVolume( config.TV_IN_VOLUME ) mixer.setIgainVolume( config.TV_IN_VOLUME ) elif event == rc.VOLUP: mixer.incIgainVolume() elif event == rc.VOLDOWN: mixer.decIgainVolume() elif event == rc.MUTE: if self.__muted: mixer.setIgainVolume( self.__igainvol ) self.__muted = 0 else: self.__igainvol = mixer.getIg...
def EventHandler(self, event): print '%s app got %s event' % (self.mode, event) if event == rc.MENU or event == rc.STOP or event == rc.SELECT or event == rc.PLAY_END: self.Stop() rc.app = None menuwidget.refresh() elif event == rc.CHUP: if self.mode == 'vcr': return # Go to the next channel in the list self.TunerNextCh...
osd.clearscreen() osd.drawstring('Action: %s' % action_str, 50, 240) osd.drawstring('Args: %s' % arg_str, 50, 280)
def eventhandler(self, event): menu = self.menustack[-1] if event == rc.UP: curr_selected = self.all_items.index(menu.selected) curr_selected = max(curr_selected-1, 0) menu.selected = self.all_items[curr_selected] self.refresh() elif event == rc.DOWN: curr_selected = self.all_items.index(menu.selected) curr_selected = ...
event = event.name[6:] print event
def eventhandler(self, event):
return data
return self.key_event_mapper(data)
def poll(self): if len(self.queue): ret = self.queue[0] del self.queue[0] return ret
if not isinstance(a, MenuItem) and len(a) > 2 and a[2] == event.arg:
if not isinstance(a, Item) and len(a) > 2 and a[2] == event.arg:
def eventhandler(self, event): menu = self.menustack[-1]
r = None if self.info.has_key(attr): r = self.info[attr] if (r == None or r == '') and hasattr(self, attr): r = getattr(self,attr) if r != None: return r return ''
r = self.info.get(attr) if r in (None, ''): r = getattr(self, attr, None) return r
def __getitem__(self, attr): """ Return the specific attribute """ if attr[:7] == 'parent(' and attr[-1] == ')' and self.parent: return self.parent[attr[7:-1]]
def drawstringframed(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top'): if not pygame.display.get_init(): return string if DEBUG: print 'drawstringframed (%d;%d; w=%d; h=%d) "%s"' % (x, y, w, h, s) if fgcolor == None: fgcolor = self.default_fg_color if...
def drawbox(self, x0, y0, x1, y1, width=None, color=None, fill=0): if not pygame.display.get_init(): return None
if key in [ "geometry" ]:
if key == "geometry": if self['width'] and self['height']: return '%sx%s' % (self['width'], self['height']) return '' if key == "date":
def __getitem__(self, key): """ return the specific attribute as string or an empty string """ if key in [ "geometry" ]: try: image = self.info if attr == 'geometry': print "geometry=%sx%s" % (image.width, image.height) return '%sx%s' % (image.width, image.height) except: pass return Item.__getitem__(self, key)
image = self.info if attr == 'geometry': print "geometry=%sx%s" % (image.width, image.height) return '%sx%s' % (image.width, image.height)
t = str(Item.__getitem__(self, key)) if t: return time.strftime(config.TV_DATETIMEFORMAT, time.strptime(t, '%Y:%m:%d %H:%M:%S'))
def __getitem__(self, key): """ return the specific attribute as string or an empty string """ if key in [ "geometry" ]: try: image = self.info if attr == 'geometry': print "geometry=%sx%s" % (image.width, image.height) return '%sx%s' % (image.width, image.height) except: pass return Item.__getitem__(self, key)
pl = Playlist(play_items, self)
pl = Playlist(self.play_items, self)
def update(self, new_files, del_files, all_files): """ update the current item set. Maybe this function can share some code with cwd in the future, but it's easier now the way it is """ new_items = [] del_items = []
self.recorder = None
self.recorder = None, None
def __init__(self, id = -1, name = 'unknown', channel = 'unknown', priority = 0, start = 0, stop = 0, info = {}, status = 'scheduled' ): self.id = id self.name = name self.channel = channel self.priority = priority self.start = start self.stop = stop self.status = status self.info = {}
if status == 'scheduled' and self.recorder:
if status == 'scheduled' and self.recorder[1]:
def __str__(self): """ A simple string representation for a recording for debugging in the recordserver. """ channel = self.channel if len(channel) > 10: channel = channel[:10] diff = (self.stop - self.start) / 60 name = self.name if len(name) > 23: name = name[:20] + u'...' name = u'"' + name + u'"' status = self.stat...
return True
return False
def __call__(self): """ Call the callback function. """ # remove from callback notifier.removeTimer(self.timer) del _callbacks[self.name] # call callback function self.function(*self.args, **self.kwargs) return True
def __escape_query(self.sql):
def __escape_query(self, sql):
def __escape_query(self.sql): """ Escape a SQL query in a manner suitable for sqlite """ if not type(sql) in StringTypes: return sql sql = sql.replace('\'','') return sql
def __escape_value(self.val):
def __escape_value(self, val):
def __escape_value(self.val): """ Escape a SQL value in a manner to be quoted inside a query """ if not type(val) in StringTypes: return val return val.replace('"', '').replace('\'', '')
if isinstance(item, str):
if isinstance(item, str) or isinstance(item, unicode):
def getoverlay(item): if not config.OVERLAY_DIR: return '' if isinstance(item, str): # it's a directory, return it directory = os.path.abspath(item) for media in config.REMOVABLE_MEDIA: if directory.startswith(media.mountdir): directory = directory[len(media.mountdir):] return os.path.join(config.OVERLAY_DIR, 'disc', ...
_debug_('register dvb device %s' % self.adapter)
def __init__(self, number): self.adapter = '/dev/dvb/adapter' + number _debug_('register dvb device %s' % self.adapter) INFO_ST = '128s10i' val = pack( INFO_ST, "", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) devfd = os.open(self.adapter + '/frontend0', os.O_TRUNC) r = ioctl(devfd, ioctl.IOR('o', 61, INFO_ST), val) os.close(devfd) ...
print self.parent
def __init__(self, parent=None, prog=None, context=None, left=None, top=None, width=600, height=None, vertical_expansion=1):
sys.exit()
sys.exit(1)
def main(): log('=' * 80) log('started at %s' % time.ctime()) schedule_init() fd = open(SCHEDULE, 'r') schedule = fd.readlines() fd.close() if schedule[0].find('#TIMESTAMP') != 0: log('Schedule corrupt! Please fix! Exiting') sys.exit() else: schedule[0] = '#TIMESTAMP ' + time.strftime('%Y-%m-%d %H:%M:%S') + '\n' lo...
if config.CONF.display == 'dxr3':
if config.CONF.display in ('dxr3', 'dfbmga'):
def __init__(self): if config.CONF.display == 'dxr3': print 'For some strange reason, the starting of the webserver inside' print 'Freevo messes up with the DXR3 output. The webserver plugin' print 'will be disabled. Start it from outside Freevo with' print 'freevo webserver [start|stop]' self.reason = 'dxr3 output' re...
print 'Freevo messes up with the DXR3 output. The webserver plugin' print 'will be disabled. Start it from outside Freevo with'
print 'Freevo messes up with the DXR3 and dfbmga output. The webserver' print 'plugin will be disabled. Start it from outside Freevo with'
def __init__(self): if config.CONF.display == 'dxr3': print 'For some strange reason, the starting of the webserver inside' print 'Freevo messes up with the DXR3 output. The webserver plugin' print 'will be disabled. Start it from outside Freevo with' print 'freevo webserver [start|stop]' self.reason = 'dxr3 output' re...
self.reason = 'dxr3 output'
self.reason = 'dxr3 or dfbmga output'
def __init__(self): if config.CONF.display == 'dxr3': print 'For some strange reason, the starting of the webserver inside' print 'Freevo messes up with the DXR3 output. The webserver plugin' print 'will be disabled. Start it from outside Freevo with' print 'freevo webserver [start|stop]' self.reason = 'dxr3 output' re...
files = [ os.path.join(self.dir, fname) for fname in os.listdir(self.dir) ]
files = ([ os.path.join(self.dir, fname) for fname in os.listdir(self.dir) ])
def cwd(self, arg=None, menuw=None): """ make a menu item for each file in the directory """ items = []
print 'util:match_files(): Got error on dir = "%s"' % dirname
print 'util:match_files(): Got error on dir = "%s"' % self.dir
def cwd(self, arg=None, menuw=None): """ make a menu item for each file in the directory """ items = []
area = area.style[0]
try: area = area.style[0] except IndexError: print 'index error for %s %s' % (display_style, widget_type) print area print area.style raise
def init_vars(self, settings, display_type, widget_type = 'menu'): """ check which layout is used and set variables for the object """ redraw = self.redraw self.settings = settings
os.system('kill -9 `pgrep -f "python main.py" -d" "` 2&> /dev/null')
os.system('kill -9 `pgrep -f "python*main.py" -d" "` 2&> /dev/null')
def shutdown(menuw=None, arg=None): osd.clearscreen(color=osd.COL_BLACK) osd.drawstring('shutting down...', osd.width/2 - 90, osd.height/2 - 10, fgcolor=osd.COL_ORANGE, bgcolor=osd.COL_BLACK) osd.update() time.sleep(0.5) osd.shutdown() # SDL must be shutdown to restore video modes etc # XXX temporary kludge so it won...
chan = Label('Channel: %s' % \
chan = Label(_('Channel: %s') % \
def __init__(self, parent=None, prog=None, context=None, left=None, top=None, width=600, height=None, vertical_expansion=1):
start = Label('Start: %s' % time.strftime(config.TV_DATETIMEFORMAT,
start = Label(_('Start: %s') % time.strftime(config.TV_DATETIMEFORMAT,
def __init__(self, parent=None, prog=None, context=None, left=None, top=None, width=600, height=None, vertical_expansion=1):
stop = Label('Stop: %s' % time.strftime(config.TV_DATETIMEFORMAT,
stop = Label(_('Stop: %s') % time.strftime(config.TV_DATETIMEFORMAT,
def __init__(self, parent=None, prog=None, context=None, left=None, top=None, width=600, height=None, vertical_expansion=1):
self.b0 = Button('Record', width=(width-60)/2)
self.b0 = Button(_('Record'), width=(width-60)/2)
def __init__(self, parent=None, prog=None, context=None, left=None, top=None, width=600, height=None, vertical_expansion=1):
self.b0 = Button('Remove', width=(width-60)/2)
self.b0 = Button(_('Remove'), width=(width-60)/2)
def __init__(self, parent=None, prog=None, context=None, left=None, top=None, width=600, height=None, vertical_expansion=1):
self.b1 = Button('CANCEL', width=(width-60)/2)
self.b1 = Button(_('CANCEL'), width=(width-60)/2)
def __init__(self, parent=None, prog=None, context=None, left=None, top=None, width=600, height=None, vertical_expansion=1):
if DEBUG: print 'ProgramDisplay: event = %s' % event
if DEBUG: print _('ProgramDisplay: event = %s') % event
def eventhandler(self, event, menuw=None): if DEBUG: print 'ProgramDisplay: event = %s' % event
text='"%s" has been scheduled for recording' % \
text=_('"%s" has been scheduled for recording') % \
def eventhandler(self, event, menuw=None): if DEBUG: print 'ProgramDisplay: event = %s' % event
text='Scheduling Failed: %s' % msg).show()
text=_('Scheduling Failed: %s') % msg).show()
def eventhandler(self, event, menuw=None): if DEBUG: print 'ProgramDisplay: event = %s' % event
text='Remove Failed: %s' % msg).show()
text=_('Remove Failed: %s') % msg).show()
def eventhandler(self, event, menuw=None): if DEBUG: print 'ProgramDisplay: event = %s' % event
text = 'Scheduled Recordings'
text = _('Scheduled Recordings')
def __init__(self, parent='osd', text=None, handler=None, left=None, top=None, width=600, height=300, bg_color=None, fg_color=None, icon=None, border=None, bd_color=None, bd_width=None, vertical_expansion=1):
errormsg = Label('Record server unavailable: %s' % msg,
errormsg = Label(_('Record server unavailable: %s') % msg,
def __init__(self, parent='osd', text=None, handler=None, left=None, top=None, width=600, height=300, bg_color=None, fg_color=None, icon=None, border=None, bd_color=None, bd_width=None, vertical_expansion=1):
errormsg = Label('Get recordings failed: %s' % recordings,
errormsg = Label(_('Get recordings failed: %s') % recordings,
def refreshList(self): (self.result, recordings) = record_client.getScheduledRecordings() if self.result: progs = recordings.getProgramList() else: errormsg = Label('Get recordings failed: %s' % recordings, self, Align.CENTER) return
media.info = videoitem.VideoItem('0', None)
media.info = videoitem.VideoItem('1', None)
def identify(self, media):
if not i.image: i.image = item.image
try: if not i.image and item.image.find('skins/images/watermarks/'): i.image = item.image except: pass
def make_submenu(self, menu_name, actions, item): items = [] for a in actions: if isinstance(a, MenuItem): items.append(a) else: items.append(MenuItem(a[1], a[0])) xml_file = None if hasattr(item, 'xml_file'): xml_file = item.xml_file
def makecategorybox(self, chanlist): allcategories = [] for chan in chanlist: for prog in chan.epg.programs: if prog.categories: allcategories.extend(prog.categories) if allcategories: allcategories=util.unique(allcategories) allcategories.sort() else: return ''
def makecategorybox(self): allcategories = ['Sports', 'News'] allcategories.sort()
def makecategorybox(self, chanlist): allcategories = [] for chan in chanlist: for prog in chan.epg.programs: if prog.categories: allcategories.extend(prog.categories) if allcategories: allcategories=util.unique(allcategories) allcategories.sort() else: return '' retval = '<select name="category">' + "\n" for cat in all...
listh = 0
listh = 24*7
def maketimejumpboxday(self, gstart): retval='<select name="day">\n' myt = time.time() myt_t = time.localtime(myt) gstart_t = time.localtime(gstart) myt = time.mktime((myt_t[0], myt_t[1], myt_t[2], 0, 0, 5, myt_t[6], myt_t[7], -1)) # listh = tv_util.when_listings_expire() listh = 0 if listh == 0: return retval + '</sel...
myoff = hrinc - hrstart
myoff = int(hrinc - hrstart)
def maketimejumpboxoffset(self, gstart): retval = '<select name="offset">\n' myt = gstart myt_t = time.localtime(myt) hrstart = time.mktime((myt_t[0], myt_t[1], myt_t[2], 0, 0, 5, myt_t[6], myt_t[7], -1)) hrinc = hrstart hrstop = hrstart + (60*60*24) while (hrinc < hrstop): myoff = hrinc - hrstart retval += '<option va...
mfrguidestart = int(mfrguideinput)
mfrguidestart = float(mfrguideinput)
def render(self, request): fv = HTMLResource() log.debug(dir(request)) form = request.query
got_schedule = False schedule = 'no schedule' if got_schedule: schedule = schedule.getProgramList()
def render(self, request): fv = HTMLResource() log.debug(dir(request)) form = request.query
if not got_schedule: fv.printMessages( [ '<b>'+_('ERROR')+'</b>: '+_('Recording server is unavailable.') ] )
got_schedule = False if not record.client.recordings.server: fv.res += '<p class="alert"><b>'+_('Notice')+'</b>: ' \ +_('The recording server is down.')+'</p>\n'
def render(self, request): fv = HTMLResource() log.debug(dir(request)) form = request.query
categorybox = 0 if categorybox: fv.tableCell('<form action="genre">'+_('Show')+'&nbsp;'+_('Category')+':&nbsp;'+categorybox+'<input type=submit value="'+_('Change')+'"></form>', 'class="utilhead"')
categorybox = self.makecategorybox() fv.tableCell('<form action="genre">'+_('Show')+'&nbsp;'+_('Category')+':&nbsp;'+categorybox+'<input type=submit value="'+_('Change')+'"></form>', 'class="utilhead"')
def render(self, request): fv = HTMLResource() log.debug(dir(request)) form = request.query
cached_guide = pickle.load(open(pname, 'r'))
try: fd = open(pname, 'r') except: print 'DEBUG: failed open of %s' % pname traceback.print_exc() try: cached_guide = pickle.load(fd) except: print 'DEBUG: failed load of the pickle' traceback.print_exc()
def get_guide(popup=None): global cached_guide # Can we use the cached version (if same as the file)? if (cached_guide == None or (os.path.isfile(config.XMLTV_FILE) and cached_guide.timestamp != os.path.getmtime(config.XMLTV_FILE))): # No, is there a pickled version ("file cache") in a file? pname = '%s/TV.xml-%s.pic...
return '%sdoc?file=%s"' % reg.groups()
href, url = reg.groups() url = os.path.join(os.path.dirname(self.page), url) url = os.path.normpath(url) return '%sdoc?file=%s"' % (href, url)
def replace_link(self, reg): return '%sdoc?file=%s"' % reg.groups()
page = request.query['file']
self.page = request.query['file']
def _render(self, request): if request.query.has_key('file'): page = request.query['file'] else: page = 'Index.html'
page = 'Index.html'
self.page = 'Index.html'
def _render(self, request): if request.query.has_key('file'): page = request.query['file'] else: page = 'Index.html'
src = os.path.join(config.DOC_DIR, 'html/%s' % page)
src = os.path.join(config.DOC_DIR, 'html/%s' % self.page)
def _render(self, request): if request.query.has_key('file'): page = request.query['file'] else: page = 'Index.html'
log.debug('GET: making a new ScheduledRecordings')
if DEBUG: log.debug('GET: making a new ScheduledRecordings')
def getScheduledRecordings(self): file_ver = None scheduledRecordings = None
log.debug('ScheduledRecordings has %s items.' % len(scheduledRecordings.programList))
if DEBUG: log.debug('ScheduledRecordings has %s items.' % len(scheduledRecordings.programList))
def getScheduledRecordings(self): file_ver = None scheduledRecordings = None
log.debug('scheduleRecording: prog.channel_id="%s" chan.id="%s" chan.tunerid="%s"' % (prog.channel_id, chan.id, chan.tunerid))
if DEBUG: log.debug('scheduleRecording: prog.channel_id="%s" chan.id="%s" chan.tunerid="%s"' % (prog.channel_id, chan.id, chan.tunerid))
def scheduleRecording(self, prog=None): global guide
log.debug('findProg: %s, %s' % (chan, start))
if DEBUG: log.debug('findProg: %s, %s' % (chan, start))
def findProg(self, chan=None, start=None): global guide
log.debug('CHANNEL MATCH')
if DEBUG: log.debug('CHANNEL MATCH')
def findProg(self, chan=None, start=None): global guide
log.debug('PROGRAM MATCH')
if DEBUG: log.debug('PROGRAM MATCH')
def findProg(self, chan=None, start=None): global guide
log.debug('findMatches: %s' % find)
if DEBUG: log.debug('findMatches: %s' % find)
def findMatches(self, find=None): global guide
log.debug('nothing to find')
if DEBUG: log.debug('nothing to find')
def findMatches(self, find=None): global guide
log.debug('PROGRAM MATCH: %s' % prog)
if DEBUG: log.debug('PROGRAM MATCH: %s' % prog)
def findMatches(self, find=None): global guide
log.debug('in checkToRecord')
if DEBUG: log.debug('in checkToRecord')
def checkToRecord(self): log.debug('in checkToRecord') rec_cmd = None rec_prog = None cleaned = None scheduledRecordings = self.getScheduledRecordings()
log.debug('checkToRecord: progloop = %s' % prog)
if DEBUG: log.debug('checkToRecord: progloop = %s' % prog)
def checkToRecord(self): log.debug('in checkToRecord') rec_cmd = None rec_prog = None cleaned = None scheduledRecordings = self.getScheduledRecordings()
log.debug('going to record: %s' % prog)
if DEBUG: log.debug('going to record: %s' % prog)
def checkToRecord(self): log.debug('in checkToRecord') rec_cmd = None rec_prog = None cleaned = None scheduledRecordings = self.getScheduledRecordings()
log.debug('found a program to clean')
if DEBUG: log.debug('found a program to clean')
def checkToRecord(self): log.debug('in checkToRecord') rec_cmd = None rec_prog = None cleaned = None scheduledRecordings = self.getScheduledRecordings()
log.debug('ap: mod=%s\n' % mod)
if DEBUG: log.debug('ap: mod=%s\n' % mod)
def adjustPriority(self, favname, mod=0): save = [] mod = int(mod) (status, me) = getFavorite(favname) oldprio = int(me.priority) newprio = oldprio + mod log.debug('ap: mod=%s\n' % mod) sr = self.getScheduledRecordings() favs = sr.getFavorites().values() sys.stderr.write('adjusting prio of '+favname+'\n') for fav in...
log.debug('MATCH')
if DEBUG: log.debug('MATCH')
def adjustPriority(self, favname, mod=0): save = [] mod = int(mod) (status, me) = getFavorite(favname) oldprio = int(me.priority) newprio = oldprio + mod log.debug('ap: mod=%s\n' % mod) sr = self.getScheduledRecordings() favs = sr.getFavorites().values() sys.stderr.write('adjusting prio of '+favname+'\n') for fav in...
log.debug('fp: %s, old: %s, new: %s\n' % (fav.priority, oldprio, newprio)) log.debug('skipping: %s\n' % fav.name)
if DEBUG: log.debug('fp: %s, old: %s, new: %s\n' % (fav.priority, oldprio, newprio)) log.debug('skipping: %s\n' % fav.name)
def adjustPriority(self, favname, mod=0): save = [] mod = int(mod) (status, me) = getFavorite(favname) oldprio = int(me.priority) newprio = oldprio + mod log.debug('ap: mod=%s\n' % mod) sr = self.getScheduledRecordings() favs = sr.getFavorites().values() sys.stderr.write('adjusting prio of '+favname+'\n') for fav in...
log.debug('moved prio of %s: %s => %s\n' % (fav.name, fav.priority-1, fav.priority))
if DEBUG: log.debug('moved prio of %s: %s => %s\n' % (fav.name, fav.priority-1, fav.priority))
def adjustPriority(self, favname, mod=0): save = [] mod = int(mod) (status, me) = getFavorite(favname) oldprio = int(me.priority) newprio = oldprio + mod log.debug('ap: mod=%s\n' % mod) sr = self.getScheduledRecordings() favs = sr.getFavorites().values() sys.stderr.write('adjusting prio of '+favname+'\n') for fav in...
log.debug('skipping: %s\n' % fav.name)
if DEBUG: log.debug('skipping: %s\n' % fav.name)
def adjustPriority(self, favname, mod=0): save = [] mod = int(mod) (status, me) = getFavorite(favname) oldprio = int(me.priority) newprio = oldprio + mod log.debug('ap: mod=%s\n' % mod) sr = self.getScheduledRecordings() favs = sr.getFavorites().values() sys.stderr.write('adjusting prio of '+favname+'\n') for fav in...
log.debug('moved prio of %s: %s => %s\n' % (fav.name, fav.priority+1, fav.priority))
if DEBUG: log.debug('moved prio of %s: %s => %s\n' % (fav.name, fav.priority+1, fav.priority))
def adjustPriority(self, favname, mod=0): save = [] mod = int(mod) (status, me) = getFavorite(favname) oldprio = int(me.priority) newprio = oldprio + mod log.debug('ap: mod=%s\n' % mod) sr = self.getScheduledRecordings() favs = sr.getFavorites().values() sys.stderr.write('adjusting prio of '+favname+'\n') for fav in...
log.debug('top of the minute in %s seconds' % next_minute)
if DEBUG: log.debug('top of the minute in %s seconds' % next_minute)
def startMinuteCheck(self): next_minute = (int(time.time()/60) * 60 + 60) - int(time.time()) log.debug('top of the minute in %s seconds' % next_minute) reactor.callLater(next_minute, self.minuteCheck)
diskfree = _('%i free of %i Mb total') % \ ( (( util.freespace(item.dir) / 1024) / 1024), ((util.totalspace(item.dir) /1024) /1024))
freespace = util.freespace(item.dir) totalspace = util.totalspace(item.dir) if (totalspace > 1073741824): diskfree = _('%i free of %i Gb total (%i%% free)') % \ ( (((freespace / 1024) / 1024) / 1024), (((totalspace / 1024) / 1024) / 1024), (freespace*100.0/totalspace) ) else: diskfree = _('%i free of %i Mb total (%i%%...
def actions(self, item): if item.type == 'dir': diskfree = _('%i free of %i Mb total') % \ ( (( util.freespace(item.dir) / 1024) / 1024), ((util.totalspace(item.dir) /1024) /1024)) return [ ( self.dud, diskfree) ] else: return []
item.image = os.path.join(dirname, item.image)
item.image = vfs.abspath(os.path.join(dirname, item.image))
def parse_video_child(fxd, node, dirname): """ parse a subitem from <video> """ filename = String(fxd.gettext(node)) media_id = fxd.getattr(node, 'media-id') mode = node.name id = fxd.getattr(node, 'id') options = fxd.getattr(node, 'mplayer-options') player = fxd.childcontent(node, 'player') pl...
menuw.hide()
self.menuw.hide()
def play(self, arg=None, menuw=None): """ Start playing the item """ self.parent.current_item = self self.elapsed = 0
print String(_('ERROR: Cannot find tuner channel "%s" in the TV channel listing')) % chan
print String(_('ERROR')+': '+\ (_('Cannot find tuner channel "%s" in the TV channel listing') % chan))
def chanSet(self, chan, app=None, app_cmd=None): new_chan = None
print 'USING CUSTOM FREQUENCY: chan="%s", freq="%s"' % \ (chan, freq)
print String('USING CUSTOM FREQUENCY: chan="%s", freq="%s"'% \ (chan, freq))
def tunerSetFreq(self, chan, app=None, app_cmd=None): chan = str(chan) vg = self.getVideoGroup(chan)
print _('ERROR: Unable to get chanlist for %s') % vg.tuner_chanlist
print String(_('ERROR')+': '+(_('Unable to get channel list for %s.') % vg.tuner_chanlist))
def tunerSetFreq(self, chan, app=None, app_cmd=None): chan = str(chan) vg = self.getVideoGroup(chan)
print _('ERROR: Unable to get frequency for %s') % chan
print String(_('ERROR')+': '+(_('Unable to get frequency for channel %s.') % chan))
def tunerSetFreq(self, chan, app=None, app_cmd=None): chan = str(chan) vg = self.getVideoGroup(chan)
print 'USING STANDARD FREQUENCY: chan="%s", freq="%s"' % \ (chan, freq)
print String('USING STANDARD FREQUENCY: chan="%s", freq="%s"' % \ (chan, freq))
def tunerSetFreq(self, chan, app=None, app_cmd=None): chan = str(chan) vg = self.getVideoGroup(chan)
print String(_('Failed to set freq for channel %s')) % chan
print String(_('Failed to set freq for channel %s.') % chan)
def tunerSetFreq(self, chan, app=None, app_cmd=None): chan = str(chan) vg = self.getVideoGroup(chan)
""" if self.layout_content is not self.layout.content:
""" update=0 try: if self.content.width != self.area_val.width or \ self.content.height != self.area_val.height or \ self.content.x != self.area_val.x or \ self.content.y != self.area_val.y: update=1 except: pass if self.layout_content is not self.layout.content or update:
def set_content( self ): """ set self.content and self.layout_content if they need to be set (return 1) or does nothing (return 0) """ if self.layout_content is not self.layout.content: types = self.layout.content.types self.content = self.calc_geometry( self.layout.content, copy_object=TRUE ) # backup types, which hav...
bg = pygame.transform.scale(bg, (self.bmovl.width, self.bmovl.height))
if bg: bg = pygame.transform.scale(bg, (self.bmovl.width, self.bmovl.height)) else: print 'Strange, no background, this will look bad!'
def show_osd(self): """ bmovl: init bmovl osd and show it """ _debug_('show osd')
self.bmovl.screenblit(bg, (0, self.y0), (0, self.y0, self.bmovl.width, self.bmovl.height - self.y0))
if bg: self.bmovl.screenblit(bg, (0, self.y0), (0, self.y0, self.bmovl.width, self.bmovl.height - self.y0))
def show_osd(self): """ bmovl: init bmovl osd and show it """ _debug_('show osd')
play_items += eval(t + '.interface.cwd(self, files)')
play_items += eval(t + '.cwd(self, files)')
def play_next(self, arg=None, menuw=None): element = random.choice(self.unplayed) self.unplayed.remove(element) if not callable(element): # try to get the item for this file files = [ element, ] play_items = [] for t in ( 'video', 'audio', 'image', 'games' ): play_items += eval(t + '.interface.cwd(self, files)')
position = (self.position * 100) / self.full
if not self.full: return position = min((self.position * 100) / self.full, 100)
def _draw(self): if not self.width or not self.height: raise TypeError, 'Not all needed variables set.'
if config.DEBUG:
if config.DEBUG > 1:
def actions(self, item): self.item = item # don't allow this for items on an audio cd, only on the disc itself if item.type == 'audio' and item.parent.type == 'audiocd': return []
import re
def __init__(self, cpu='temp3', case='temp2' , ram='MemTotal'): IdleBarPlugin.__init__(self) import re self.hotstack = 0 self.case = None if isinstance (cpu,types.StringType): self.cpu = self.sensor(cpu, '@', self.hotstack) else: self.cpu = self.sensor(cpu[0], cpu[1], self.hotstack) if case: if isinstance (case,typ...
if arg:
if arg or arg == 0:
def __init__(self, name, arg=None, context=None): if isinstance(name, Event): self.name = name.name self.arg = name.arg self.context = name.context else: self.name = name self.arg = None self.context = None if arg: self.arg = arg
def __init__(self, format='%a %I:%M %P'): IdleBarPlugin.__init__(self)
def __init__(self, format=''): IdleBarPlugin.__init__(self) if format == '': if time.strftime('%P') =='': format ='%a %H:%M' else: format ='%a %I:%M %P'
def __init__(self, format='%a %I:%M %P'): IdleBarPlugin.__init__(self) self.timeformat = format
else: icon_x = 0
def update_content(self): """ update the listing area """
TV_SETTINGS['dvb%s' % i] = DVBCard
try: TV_SETTINGS['dvb%s' % i] = DVBCard except OSError: continue except: traceback.print_exc()
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...
event = pygame.event.poll() if event.type == NOEVENT: return None if event.type == KEYDOWN: if event.key == K_h: self._helpscreen() elif event.key == K_z: pygame.display.toggle_fullscreen() elif event.key == K_F10: pygame.image.save(self.screen, '/tmp/freevo_ss%s.bmp' % self._screenshotnum) self._screenshotnum += 1 e...
while 1: event = pygame.event.poll() if event.type == NOEVENT: return None if event.type == KEYDOWN: if event.key == K_h:
def _cb(self):