Author: duncan Date: Fri Nov 3 07:30:42 2006 New Revision: 8533 Modified: branches/rel-1/freevo/src/encodingcore.py branches/rel-1/freevo/src/plugins/upsoon.py branches/rel-1/freevo/src/video/encodingclient.py
Log: Comment line length tidy-up CHanged debugging messages Modified: branches/rel-1/freevo/src/encodingcore.py ============================================================================== --- branches/rel-1/freevo/src/encodingcore.py (original) +++ branches/rel-1/freevo/src/encodingcore.py Fri Nov 3 07:30:42 2006 @@ -7,8 +7,9 @@ # Author: den_RDC # some parts taken or inspired by Quickrip (by T. Chance, GPL, # http://quickrip.sf.net) -# TODO: +# Todo: # niceness & pausing queue +# different containers (Matroska) # # ----------------------------------------------------------------------- # Copyright (C) 2004 den_RDC (RVDM) @@ -210,7 +211,8 @@ """Calculates the video bitrate""" self.vbrate = int((((int(self.tgtsize)*8) / int(self.length)) - int(self.abrate)) / 0.98) - if self.vbrate > 12000: #we got a very short file, very high bitrates are interpreted as bit/s instead of kbit/s, shitty qual + #we got a very short file, very high bitrates are interpreted as bit/s instead of kbit/s, shitty qual + if self.vbrate > 12000: self.vbrate = 6000 @@ -327,7 +329,8 @@ if self.crop != None: vf += [ "crop=%s" % self.crop ] - #in case of xvid and anamorphic dvd, add scaling to compensate AR.. if we didn't find cropping we have no res, so no tricks + #in case of xvid and anamorphic dvd, add scaling to compensate AR.. + #if we didn't find cropping we have no res, so no tricks if self.vcodec == "XViD" and (self.crop != None): if self.ana: #calculate a decent resized picturesize, res must still be a multiple of 16 @@ -514,8 +517,6 @@ - - #command executing class - Taken from Quickrip & adapted. class CommandThread(threading.Thread): # seek to remove data andor crop (not really used) """Handle threading of external commands""" Modified: branches/rel-1/freevo/src/plugins/upsoon.py ============================================================================== --- branches/rel-1/freevo/src/plugins/upsoon.py (original) +++ branches/rel-1/freevo/src/plugins/upsoon.py Fri Nov 3 07:30:42 2006 @@ -1,6 +1,6 @@ # -*- coding: iso-8859-1 -*- # ----------------------------------------------------------------------- -# interrupt player +# Stop the playing and listening when something is upsoon # ----------------------------------------------------------------------- # $Id: upsoon.py $ # @@ -45,9 +45,6 @@ from gui import AlertBox from event import * -# set the base debug level -dbglvl=1 - class PluginInterface( plugin.DaemonPlugin ): """ @@ -74,7 +71,7 @@ """ init the upsoon plugin """ - _debug_('__init__(self)', dbglvl+1) + _debug_('__init__(self)', 2) plugin.DaemonPlugin.__init__(self) self.lock = thread.allocate_lock() self.poll_interval = 3000 #30 secs @@ -84,16 +81,16 @@ server_string = 'http://%s:%s/' % (config.RECORDSERVER_IP, config.RECORDSERVER_PORT) - _debug_('%s' % server_string, dbglvl) + _debug_('%s' % server_string) self.server = xmlrpclib.Server(server_string, allow_none=1) - _debug_('%s' % self.server, dbglvl) + _debug_('%s' % self.server) self.serverup = None self.next_program = self.findNextProgram() # strange, doesn't work with non-ascii characters #_debug_('%s:%s chan=%s %s->%s' % (self.next_program.title.encode('utf-8'), \ # self.next_program.sub_title.encode('utf-8'), self.next_program.channel_id, \ - # time.localtime(self.next_program.start), time.localtime(self.next_program.stop)), dbglvl+1) + # time.localtime(self.next_program.start), time.localtime(self.next_program.stop)), 2) self.fc = FreevoChannels() self.seconds_before_start = 60 @@ -102,14 +99,12 @@ def findNextProgram(self): - """ - returns the next program that will be recorded - """ - _debug_('findNextProgram(self)', dbglvl+1) + """ returns the next program that will be recorded """ + _debug_('findNextProgram(self)', 2) serverup = True try: (status, message) = self.server.findNextProgram() - _debug_('status=%s, message=%s' % (status, message), dbglvl+2) + _debug_('status=%s, message=%s' % (status, message), 3) except TypeError: _debug_('TypeError exception') status = False @@ -139,11 +134,11 @@ """ Check with the record server if suspended by user """ - _debug_('isPlayerRunning(self)', dbglvl+1) + _debug_('isPlayerRunning(self)', 2) serverup = True try: (status, message) = self.server.isPlayerRunning() - _debug_('status=%s, message=%s' % (status, message), dbglvl+2) + _debug_('status=%s, message=%s' % (status, message), 3) except Exception, e: serverup = False message = None @@ -168,7 +163,7 @@ """ Return is a player is running """ - _debug_('getPlayerRunning(self)', dbglvl+1) + _debug_('getPlayerRunning(self)', 2) return self.is_player_running @@ -185,10 +180,10 @@ Sends a poll message to the record server """ now=time.time() - _debug_('poll(self)', dbglvl+1) + _debug_('poll(self)', 2) self.next_program = self.findNextProgram() - _debug_('now=%s next_program=%s ' % (time.strftime('%T', time.localtime(now)), self.next_program), dbglvl) + _debug_('now=%s next=%s ' % (time.strftime('%T', time.localtime(now)), self.next_program)) if self.next_program == None: return None @@ -207,12 +202,12 @@ return None secs_to_next = self.next_program.start - config.TV_RECORD_PADDING_PRE - int(now + 0.5) - _debug_('next recording in %s secs' % (secs_to_next), dbglvl) + _debug_('next recording in %s secs' % (secs_to_next)) # stop the player 60 seconds before recording is due to start if (secs_to_next > self.seconds_before_start): return None - _debug_('recording in less that a minute (%s secs)' % (secs_to_next), dbglvl) + _debug_('recording in less that a minute (%s secs)' % (secs_to_next)) open(self.pending_lockfile, 'w').close() try: @@ -223,7 +218,7 @@ os.read(dev_fh, 1) except OSError: rc.post_event(STOP) - _debug_('video device \"%s\" in use' % (vdev), dbglvl) + _debug_('video device \"%s\" in use' % (vdev)) rc.post_event(Event(OSD_MESSAGE, arg=_('A recording will start in less than a minute'))) # The alert box doesn't work #AlertBox(text=_('Sorry, a program is about to start recording. '), height=200).show() @@ -242,7 +237,7 @@ os.read(dev_fh, 1) except OSError: rc.post_event(STOP) - _debug_('radio device \"%s\" in use' % (rdev), dbglvl) + _debug_('radio device \"%s\" in use' % (rdev)) rc.post_event(Event(OSD_MESSAGE, arg=_('A recording will start in less than a minute'))) # Need to go back one menu, the alert box doesn't work #AlertBox(text=_('Sorry, a program is about to start recording. '), height=200).show() @@ -253,17 +248,15 @@ def eventhandler( self, event, menuw=None ): - """ - Processes user events + """ Processes user events TODO - something useful - """ + something useful """ self.lock.acquire() _debug_('eventhandler(self, %s, %s) name=%s arg=%s context=%s handler=%s' % \ - (event, menuw, event.name, event.arg, event.context, event.handler), dbglvl+2) + (event, menuw, event.name, event.arg, event.context, event.handler), 3) - _debug_('event name=%s arg=%s' % (event.name, event.arg), dbglvl) + _debug_('event name=%s arg=%s' % (event.name, event.arg)) self.lock.release() Modified: branches/rel-1/freevo/src/video/encodingclient.py ============================================================================== --- branches/rel-1/freevo/src/video/encodingclient.py (original) +++ branches/rel-1/freevo/src/video/encodingclient.py Fri Nov 3 07:30:42 2006 @@ -379,6 +379,3 @@ print getProgress() sleep(5) print getProgress() - - - ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Freevo-cvslog mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freevo-cvslog
