Author: duncan
Date: Thu Feb 21 15:47:49 2008
New Revision: 10406

Log:
Consolidating differencies between rel-1 and rel-1-7


Modified:
   branches/rel-1-7/freevo/src/plugins/alsamixer2.py
   branches/rel-1-7/freevo/src/plugins/autoshutdown.py
   branches/rel-1-7/freevo/src/plugins/buttonbar.py
   branches/rel-1-7/freevo/src/plugins/df.py
   branches/rel-1-7/freevo/src/plugins/freevo-rendezvous.py
   branches/rel-1-7/freevo/src/plugins/freevoscreensaver.py
   branches/rel-1-7/freevo/src/plugins/idlebar/__init__.py
   branches/rel-1-7/freevo/src/plugins/idlebar/diskfree.py
   branches/rel-1-7/freevo/src/plugins/idlebar/system.py
   branches/rel-1-7/freevo/src/plugins/idlebar/transcode.py
   branches/rel-1-7/freevo/src/plugins/lcd.py
   branches/rel-1-7/freevo/src/plugins/remind.py
   branches/rel-1-7/freevo/src/plugins/screensaver/__init__.py
   branches/rel-1-7/freevo/src/plugins/vfd.py
   branches/rel-1/freevo/src/plugins/buttonbar.py
   branches/rel-1/freevo/src/plugins/vfd.py

Modified: branches/rel-1-7/freevo/src/plugins/alsamixer2.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/alsamixer2.py   (original)
+++ branches/rel-1-7/freevo/src/plugins/alsamixer2.py   Thu Feb 21 15:47:49 2008
@@ -52,40 +52,40 @@
     The plugin uses the following configuration variables, which need to be
     defined in local_conf.py:
 
-    ALSAMIXER2_MAIN_CTRL = <control name>
-        This is the mixer control that the plugin will use for handling volume
-        (up and down) events. The control name needs to be a string as returned
-        by 'amixer scontrols', i.e., 'PCM', 'Vol', or such.
-        If this variable is not set, the first entry in the controls list (see
-        below) will be used.
-
-    ALSAMIXER2_MUTE_CTRL = <control name>
-        This is the mixer control that the plugin will use for handling mute
-        events. Some systems use different controls for volume and muting.
-        If this variable is not set, the main control will be used for muting.
-
-    ALSAMIXER2_CTRLS = [
-        ( <control name>, <card name>, <default vol>, <min vol>, <max vol> ),
-        ...
-    ]
+    | ALSAMIXER2_MAIN_CTRL = <control name>
+    |     This is the mixer control that the plugin will use for handling 
volume
+    |     (up and down) events. The control name needs to be a string as 
returned
+    |     by 'amixer scontrols', i.e., 'PCM', 'Vol', or such.
+    |     If this variable is not set, the first entry in the controls list 
(see
+    |     below) will be used.
+    |
+    | ALSAMIXER2_MUTE_CTRL = <control name>
+    |     This is the mixer control that the plugin will use for handling mute
+    |     events. Some systems use different controls for volume and muting.
+    |     If this variable is not set, the main control will be used for 
muting.
+    |
+    | ALSAMIXER2_CTRLS = [
+    |     ( <control name>, <card name>, <default vol>, <min vol>, <max vol> ),
+    |     ...
+    | ]
 
     This is a list of mixer controls that the plugin will use. Each entry of
     the list represent one control and contains the following items:
-    <control name>  The name of this mixer control.
-    <card name>     The name of the card that this control lives on. Use
-                    something like 'hw:0'. To use the default card, use
-                    'default' or leave it empty ('').
-    <default vol>   Default volume for this control. The plugin will set
-                    this control to this value upon initialization if the
-                    value is >= 0,
-    <min vol>       Minimum volume. This is the minimum volume that can be
-                    reached with 'volume down' events. This item makes only
-                    sense for the main control and can be omitted for other
-                    controls.
-    <max vol>       Maximum volume. This is the maximum volume that can be
-                    reached with 'volume up' events. This item makes only
-                    sense for the main control and can be omitted for other
-                    controls.
+        - <control name>  The name of this mixer control.
+        - <card name>     The name of the card that this control lives on. Use
+                          something like 'hw:0'. To use the default card, use
+                          'default' or leave it empty ('').
+        - <default vol>   Default volume for this control. The plugin will set
+                          this control to this value upon initialization if the
+                          value is >= 0,
+        - <min vol>       Minimum volume. This is the minimum volume that can 
be
+                          reached with 'volume down' events. This item makes 
only
+                          sense for the main control and can be omitted for 
other
+                          controls.
+        - <max vol>       Maximum volume. This is the maximum volume that can 
be
+                          reached with 'volume up' events. This item makes only
+                          sense for the main control and can be omitted for 
other
+                          controls.
 
     Example:
     | ALSAMIXER2_MAIN_CTRL = 'PCM'

Modified: branches/rel-1-7/freevo/src/plugins/autoshutdown.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/autoshutdown.py (original)
+++ branches/rel-1-7/freevo/src/plugins/autoshutdown.py Thu Feb 21 15:47:49 2008
@@ -1,6 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 # -----------------------------------------------------------------------
-# autoshutdown.py - Automated Shutdown
+# Automated Shutdown
 # -----------------------------------------------------------------------
 # $Id$
 #
@@ -64,9 +64,7 @@
 
 class ExRecordingInProgress(Exception) : pass
 
-# ***************************************************************
-# CLASS PluginInterface
-# ***************************************************************
+
 class PluginInterface(plugin.MainMenuPlugin):
     """
     Plugin to shutdown Freevo from the main menu
@@ -123,7 +121,18 @@
 
     """
 
+    def config(self):
+        return [
+            ('SHUTDOWN_SYS_ENABLE', 1, 'System shutdown enabled'),
+            ('AUTOSHUTDOWN_METHOD', 'acpi', 'acpi or nvram'),
+            ('AUTOSHUTDOWN_WAKEUP_CMD', None, 'path to the wakeup script'),
+            ('AUTOSHUTDOWN_DEFAULT_WAKEUP_TIME', '13:00', 'Daily wake up 
time'),
+            ('AUTOSHUTDOWN_FORCE_DEFAULT_WAKEUP', True, 'Force daily wake up'),
+        ]
+
+
     def items(self, parent):
+        _debug_('items(parent=%r)' % (parent,), 2)
         return [ ShutdownMenuItem(parent) ]
 
 
@@ -132,6 +141,7 @@
 # ***************************************************************
 class ShutdownMenuItem(Item):
     def __init__(self, parent=None):
+        _debug_('ShutdownMenuItem.__init__(parent=%r)' % (parent,), 2)
         Item.__init__(self, parent, skin_type='shutdown')
         self.idletimer = plugin.getbyname('autoshutdowntimer')
 
@@ -139,6 +149,7 @@
     # TEXT FORMATTING
     # -----------------------------------------------------------
     def message_check(self, wakeup=False):
+        _debug_('message_check(wakeup=%r)' % (wakeup,), 2)
         try:
             is_shutdown_allowed()
         except ExRecordingInProgress:
@@ -169,6 +180,7 @@
     # ACTIONS
     # -----------------------------------------------------------
     def actions(self):
+        _debug_('actions()', 2)
         if (self.idletimer.ispaused()):
             itemname = _('Resume automatic shutdown')
         else:
@@ -187,6 +199,7 @@
     # CONFIRMATION
     # -----------------------------------------------------------
     def confirm_shutdown_wakeup(self, arg=None, menuw=None):
+        _debug_('confirm_shutdown_wakeup(arg=%r, menuw=%r)' % (arg, menuw), 2)
         if config.AUTOSHUTDOWN_CONFIRM:
             title = _('SHUTDOWN SYSTEM?')
             info = self.message_check(wakeup=True)
@@ -197,10 +210,12 @@
 
 
     def confirm_toggle_timer(self, arg=None, menuw=None):
+        _debug_('confirm_toggle_timer(arg=%r, menuw=%r)' % (arg, menuw), 2)
         self.toggle_timer(arg, menuw)
 
 
     def confirm_restart_system(self, arg=None, menuw=None):
+        _debug_('confirm_restart_system(arg=%r, menuw=%r)' % (arg, menuw), 2)
         if config.AUTOSHUTDOWN_CONFIRM:
             title = _('RESTART SYSTEM?')
             info = self.message_check(wakeup=False)
@@ -215,6 +230,7 @@
 
 
     def confirm_shutdown_system(self, arg=None, menuw=None):
+        _debug_('confirm_shutdown_system(arg=%r, menuw=%r)' % (arg, menuw), 2)
         if config.AUTOSHUTDOWN_CONFIRM:
             title = _('SHUTDOWN SYSTEM?')
             info = self.message_check(wakeup=False)
@@ -229,6 +245,7 @@
 
 
     def confirm_shutdown_freevo(self, arg=None, menuw=None):
+        _debug_('confirm_shutdown_freevo(arg=%r, menuw=%r)' % (arg, menuw), 2)
         if config.AUTOSHUTDOWN_CONFIRM:
             title = _('SHUTDOWN FREEVO?')
             info = self.message_check(wakeup=False)
@@ -246,10 +263,12 @@
     # ACTIONS
     # -----------------------------------------------------------
     def shutdown_wakeup(self, arg=None, menuw=None):
+        _debug_('shutdown_wakeup(arg=%r, menuw=%r)' % (arg, menuw), 2)
         shutdown_action(action=Shutdown.SHUTDOWN_WAKEUP)
 
 
     def toggle_timer(self, arg=None, menuw=None):
+        _debug_('toggle_timer(arg=%r, menuw=%r)' % (arg, menuw), 2)
         if (self.idletimer.ispaused()):
             newname = _('Pause automatic shutdown')
             self.idletimer.resume()
@@ -269,14 +288,17 @@
 
 
     def restart_system(self, arg=None, menuw=None):
+        _debug_('restart_system(arg=%r, menuw=%r)' % (arg, menuw), 2)
         shutdown_action(action=Shutdown.RESTART_SYSTEM)
 
 
     def shutdown_system(self, arg=None, menuw=None):
+        _debug_('shutdown_system(arg=%r, menuw=%r)' % (arg, menuw), 2)
         shutdown_action(action=Shutdown.SHUTDOWN_SYSTEM)
 
 
     def shutdown_freevo(self, arg=None, menuw=None):
+        _debug_('shutdown_freevo(arg=%r, menuw=%r)' % (arg, menuw), 2)
         shutdown_action(action=Shutdown.SHUTDOWN_FREEVO)
 
 
@@ -315,6 +337,7 @@
 
 
     def __init__(self):
+        _debug_('autoshutdowntimer.__init__()', 2)
         plugin.DaemonPlugin.__init__(self)
         self.plugin_name = 'autoshutdowntimer'
         self.event_listener = True
@@ -326,35 +349,41 @@
 
 
     def ispaused(self):
+        _debug_('ispaused()', 2)
         return self.lock
 
 
     def pause(self):
+        _debug_('pause()', 2)
         self.lock = True
         _debug_("autoshutdown timer paused")
 
 
     def resume(self):
+        _debug_('resume()', 2)
         self.lock = False
         self.reset()
         _debug_("autoshutdown timer resumed")
 
 
     def reset(self):
+        _debug_('reset()', 2)
         self.idle_base = time.time()
         self.delay = 0
         _debug_("autoshutdown timer reset", 2)
 
 
     def eventhandler(self, event=None, menuw=None, arg=None):
+        _debug_('eventhandler(event=%r, menuw=%r, arg=%r)' % (event, menuw, 
arg), 2)
         if not self.lock:
-            if not event.name == 'IDENTIFY_MEDIA' and not event.name == 
'SCREENSAVER_START':
+            if plugin.isevent(event) != 'IDENTIFY_MEDIA' and event.name != 
'SCREENSAVER_START':
                 self.reset()
                 _debug_("timer reset, received event %s" % event.name, 2)
         return FALSE
 
 
     def poll(self):
+        _debug_('poll()', 2)
         if not self.lock:
             # calculate passed and remaining time
             tdif = (time.time() - self.idle_base)
@@ -392,23 +421,24 @@
 # CLASS SHUTDOWN
 # ***************************************************************
 class Shutdown:
+
     SHUTDOWN_WAKEUP, RESTART_SYSTEM, SHUTDOWN_SYSTEM, SHUTDOWN_FREEVO, IGNORE  
= range(5)
 
 
 # ***************************************************************
 # PUBLIC HELPER FUNTIONS
 # ***************************************************************
-# -----------------------------------------------------------
-# is_shutdown_allowed
-# checks if a shutdown is allowed
-# -----------------------------------------------------------
-# Input:    None
-# Result:   True or excetion
-# Raises:   ExRecordingInProgress if there is a recording
-#           ExNextWakeupSoon if the next wakeup is nearby
-#           ExProcessRunning if there is an important process
-# -----------------------------------------------------------
+
 def is_shutdown_allowed():
+    """
+    checks if a shutdown is allowed
+
+    @returns: True or excetion
+    @raises ExRecordingInProgress: if there is a recording
+    @raises ExNextWakeupSoon: if the next wakeup is nearby
+    @raises ExProcessRunning: if there is an important process
+    """
+    _debug_('is_shutdown_allowed()', 2)
     now = time.time()
     try:
         t = __get_scheduled_recording(0)
@@ -436,6 +466,7 @@
 # Raises:   ExNoWakeupNeeded if no wakeup needed
 # -----------------------------------------------------------
 def get_next_wakeup():
+    _debug_('get_next_wakeup()', 2)
     scheduled_utc_s = 0
     default_utc_s = 0
     now = time.time()
@@ -445,10 +476,10 @@
         try:
             scheduled_utc_s = __get_scheduled_recording(i)
         except ExNoRecordServer:
-            _debug_("Record serer is down")
+            _debug_("Record server is down")
             break
         except ExRecordServerRemote:
-            _debug_("Record serer is remote")
+            _debug_("Record server is remote")
             break
         except ExIndexNotAvailable:
             _debug_("No more recordings available")
@@ -488,6 +519,7 @@
 # Raises:   -
 # -----------------------------------------------------------
 def shutdown_action(action=None):
+    _debug_('shutdown_action(action=%r)' % (action,), 2)
     if (action == Shutdown.SHUTDOWN_WAKEUP):
         _debug_("shutdown wakeup")
         action = __schedule_wakeup_and_shutdown()
@@ -528,6 +560,7 @@
 # Raises:   -
 # -----------------------------------------------------------
 def __schedule_wakeup_and_shutdown():
+    _debug_('__schedule_wakeup_and_shutdown()', 2)
     try:
         wakeup_utc_s = get_next_wakeup()
     except ExNoWakeupNeeded:
@@ -584,15 +617,15 @@
     return next_action
 
 
-# -----------------------------------------------------------
-# __cleanup_freevo
-# Performs necessary actions for freevo shutdown
-# -----------------------------------------------------------
-# Input:    -
-# Result:   -
-# Raises:   -
-# -----------------------------------------------------------
 def __cleanup_freevo():
+    _debug_('__cleanup_freevo()', 2)
+    """
+    # Performs necessary actions for freevo shutdown
+    # -----------------------------------------------------------
+    # Input:    -
+    # Result:   -
+    # Raises:   -
+    """
     import osd
     import plugin
     import rc
@@ -632,6 +665,7 @@
 # Result:   True/False
 # -----------------------------------------------------------
 def __is_recordserver_remote():
+    _debug_('__is_recordserver_remote()', 2)
     if len(glob.glob('/var/run/recordserver*.pid'))>0:
         return False
     elif len(glob.glob('/tmp/recordserver*.pid'))>0:
@@ -640,18 +674,17 @@
         return True
 
 
-# -----------------------------------------------------------
-# __get_scheduled_recording
-# Get the start time of a recording from the reordserver
-# -----------------------------------------------------------
-# Input:    index 0..n
-# Result:   UTC time of next recording
-# Raises:   ExNoRecordServer if the recordserver is down
-#           ExRecordServerRemote if the recordserver is on
-#                                a different machine
-#           ExIndexNotAvailable
-# -----------------------------------------------------------
 def __get_scheduled_recording(index):
+    """
+    Get the start time of a recording from the reordserver
+
+    @param index: 0..n
+    @returns: UTC time of next recording
+    @raises ExNoRecordServer: if the recordserver is down
+    @raises ExRecordServerRemote: if the recordserver is on a different machine
+    @raises ExIndexNotAvailable:
+    """
+    _debug_('__get_scheduled_recording(index=%r)' % (index,), 2)
     if __is_recordserver_remote():
         raise ExRecordServerRemote
     try:
@@ -703,6 +736,7 @@
 # Raises:   ExNoDefaultWakeup if default wakeup not available
 # -----------------------------------------------------------
 def __get_next_default_wakeup():
+    _debug_('__get_next_default_wakeup()', 2)
     if not config.AUTOSHUTDOWN_DEFAULT_WAKEUP_TIME:
         raise ExNoDefaultWakeup
     else:
@@ -742,6 +776,7 @@
 # Raises:   -
 # -----------------------------------------------------------
 def __check_processes():
+    _debug_('__check_processes()', 2)
     if not config.AUTOSHUTDOWN_PROCESS_LIST:
         return False
     else:
@@ -766,6 +801,7 @@
 # Raises:   -
 # -----------------------------------------------------------
 def __syscall(cmd, pretend=False):
+    _debug_('__syscall(cmd=%r, pretend=%r)' % (cmd, pretend), 2)
     result = 0
     if pretend:
         _debug_("Pretending syscall: %s" % cmd)

Modified: branches/rel-1-7/freevo/src/plugins/buttonbar.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/buttonbar.py    (original)
+++ branches/rel-1-7/freevo/src/plugins/buttonbar.py    Thu Feb 21 15:47:49 2008
@@ -1,6 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 # -----------------------------------------------------------------------
-# buttonbar.py-ButtonBar plugin
+# ButtonBar plug-in
 # -----------------------------------------------------------------------
 # $Id$
 #
@@ -75,13 +75,13 @@
     | plugin.activate('buttonbar')
 
     Where the actions mapped to each of the colors can be one of the following:
-        * info - Brings up a screen displaying more information than can be 
displayed
+        - info - Brings up a screen displaying more information than can be 
displayed
           in the few lines available on the TV guide page.
-        * record - Same as the record button.
-        * adv:<number> - Special action to allow navigation of the TV Guide,
+        - record - Same as the record button.
+        - adv:<number> - Special action to allow navigation of the TV Guide,
           <number> can be either positive or negative and is the number of 
hours
           to go forward/back.
-        * now - jumps back to the currently running program
+        - now - jumps back to the currently running program
 
     You can also map the following actions to unused keys of your keyboard
     (For example):

Modified: branches/rel-1-7/freevo/src/plugins/df.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/df.py   (original)
+++ branches/rel-1-7/freevo/src/plugins/df.py   Thu Feb 21 15:47:49 2008
@@ -1,7 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 # -----------------------------------------------------------------------
-# df.py - really simple diskfree plugin for freevo
-# created by den_RDC
+# Simple diskfree plugin for freevo
 # -----------------------------------------------------------------------
 # $Id$
 #
@@ -31,6 +30,7 @@
 #
 # -----------------------------------------------------------------------
 
+__author__ = 'den_RDC ([EMAIL PROTECTED])'
 
 import plugin
 import util

Modified: branches/rel-1-7/freevo/src/plugins/freevo-rendezvous.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/freevo-rendezvous.py    (original)
+++ branches/rel-1-7/freevo/src/plugins/freevo-rendezvous.py    Thu Feb 21 
15:47:49 2008
@@ -44,11 +44,11 @@
     """
     Rendezvous Broadcaster Plugin
 
-    See: http://www.porchdogsoft.com/products/howl/ (Win32 
Plugin/Linux/FreeBSD)
+    U{Win32 Plugin/Linux/FreeBSD <http://www.porchdogsoft.com/products/howl/>}
 
-    This plugin has been tested with
-       * Safari on Mac OS X Panther
-       * IE6 + Howl on Windows XP
+    This plugin has been tested with:
+       - Safari on Mac OS X Panther
+       - IE6 + Howl on Windows XP
 
     To enable this plugin, add to your local_conf.py:
     | plugin.activate('freevo-rendezvous')
@@ -60,8 +60,9 @@
         plugin.DaemonPlugin.__init__(self)
         desc = {'version':version.__version__}
         myip = self.my_ipaddr('localhost')
-        info = Rendezvous.ServiceInfo("_http._tcp.local.", "Freevo 
Web._http._tcp.local.", address=socket.inet_aton(myip),
-            port=config.WEBSERVER_PORT, weight=0, priority=0, properties=desc, 
server=socket.gethostname)
+        info = Rendezvous.ServiceInfo("_http._tcp.local.", "Freevo 
Web._http._tcp.local.", \
+            address=socket.inet_aton(myip), port=config.WEBSERVER_PORT, \
+            weight=0, priority=0, properties=desc, server=socket.gethostname)
         r.registerService(info)
 
     def my_ipaddr(self,interface_hostname=None):

Modified: branches/rel-1-7/freevo/src/plugins/freevoscreensaver.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/freevoscreensaver.py    (original)
+++ branches/rel-1-7/freevo/src/plugins/freevoscreensaver.py    Thu Feb 21 
15:47:49 2008
@@ -102,7 +102,7 @@
         eventhandler to handle the events. Always return false since we
         are just a listener and really can't send back true.
         """
-        _debug_("Saver saw %s" % event.name)
+        _debug_('Saver saw %s' % (event.name), 2)
         if menuw:
             self.menuw = menuw
 
@@ -115,24 +115,25 @@
             return FALSE
 
         # gotta ignore these or video screensavers shutoff before they begin
-        if event.name == 'VIDEO_START' or event.name == 'PLAY_START' or 
event.name == 'VIDEO_END' or event.name == 'PLAY_END':
+        if event.name == 'VIDEO_START' or event.name == 'PLAY_START' or \
+            event.name == 'VIDEO_END' or event.name == 'PLAY_END':
             return FALSE
 
         if self.screensaver_showing :
             self.stop_saver()
 
-        if not event.name == 'IDENTIFY_MEDIA':
+        if plugin.isevent(event) != 'IDENTIFY_MEDIA':
             self.last_event = time.time()
 
         return FALSE
 
     def poll(self):
-        _debug_("Saver got polled %f" % time.time())
+        _debug_('Saver got polled %f' % time.time())
         if not self.screensaver_showing and (time.time() - self.last_event) > 
self.saver_delay :
-            rc.post_event(em.Event("SCREENSAVER_START"))
+            rc.post_event(em.Event('SCREENSAVER_START'))
 
     def start_saver (self):
-        _debug_("start screensaver")
+        _debug_('start screensaver')
         self.screensaver_showing = TRUE
         if self.saver_type == 'xscreensaver':
             os.system('%s -no-splash &' % self.arg1)
@@ -153,13 +154,13 @@
                     arg = '-nosound -loop 0'
                 self.pl.play(arg=arg, menuw=self.menuw)
             else:
-                _debug_("saver thinks fxd blew up trying to parse?")
+                _debug_('saver thinks fxd blew up trying to parse?')
         else:
-            _debug_("Unknown saver type to start.")
+            _debug_('Unknown saver type to start.')
 
 
-    def stop_saver (self):
-        _debug_("stop screensaver")
+    def stop_saver(self):
+        _debug_('stop screensaver')
         self.screensaver_showing = FALSE
         if self.saver_type == 'xscreensaver':
             os.system('%s -exit' % self.arg2)
@@ -170,7 +171,7 @@
         elif self.saver_type == 'fxd':
             rc.post_event(em.STOP)
         else:
-            _debug_("Unknown saver type to stop.")
+            _debug_('Unknown saver type to stop.')
 
         time.sleep(1)
         self.osd.update()

Modified: branches/rel-1-7/freevo/src/plugins/idlebar/__init__.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/idlebar/__init__.py     (original)
+++ branches/rel-1-7/freevo/src/plugins/idlebar/__init__.py     Thu Feb 21 
15:47:49 2008
@@ -136,7 +136,8 @@
 class IdleBarPlugin(plugin.Plugin):
     """
     To activate the idle bar, put the following in your local_conf.py:
-        plugin.activate('idlebar')
+    | plugin.activate('idlebar')
+
     You can then add various plugins. Plugins inside the idlebar are
     sorted based on the level (except the clock, it's always on the
     right side). Use "freevo plugins -l" to see all available plugins,

Modified: branches/rel-1-7/freevo/src/plugins/idlebar/diskfree.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/idlebar/diskfree.py     (original)
+++ branches/rel-1-7/freevo/src/plugins/idlebar/diskfree.py     Thu Feb 21 
15:47:49 2008
@@ -1,10 +1,8 @@
 # -*- coding: iso-8859-1 -*-
 # -----------------------------------------------------------------------
-# diskfree.py - IdleBarplugin for showing the freedisk space for recording
+# IdleBar plug-in for showing the freedisk space for recording
 # -----------------------------------------------------------------------
 # $Id$
-#
-# Author: Tanja Kotthaus <[EMAIL PROTECTED]>
 # -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework
 # Copyright (C) 2003 Krister Lagerstrom, et al.
@@ -26,6 +24,7 @@
 #
 # -----------------------------------------------------------------------
 
+__author__ = 'Tanja Kotthaus <[EMAIL PROTECTED]>'
 
 # python modules
 import time
@@ -109,20 +108,20 @@
             self.percent = (self.totalspace - self.freespace) * 1.0 / 
self.totalspace
 
 
-    def draw(self, (type,object),x,osd):
+    def draw(self, (type, object), x, osd):
         """
         Drawing to idlebar
         """
         self.getDiskFree()
         diskimg = self.getimage(self.diskimg, osd)
-        w,h = diskimg.get_size()
+        w, h = diskimg.get_size()
         if self.freespace < config.DISKFREE_VERY_LOW:
             diskbar = self.getimage(self.badimg, osd, True)
         elif self.freespace < config.DISKFREE_LOW:
             diskbar = self.getimage(self.poorimg, osd, True)
         else:
             diskbar = self.getimage(self.goodimg, osd, True)
-        diskimg.blit(diskbar, (0,0), (0, 0, (w * self.percent), h))
+        diskimg.blit(diskbar, (0, 0), (0, 0, (w * self.percent), h))
         self.cacheimg['cached'] = diskimg
         font = osd.get_font('small0')
         widthdf = font.stringsize(self.diskfree)

Modified: branches/rel-1-7/freevo/src/plugins/idlebar/system.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/idlebar/system.py       (original)
+++ branches/rel-1-7/freevo/src/plugins/idlebar/system.py       Thu Feb 21 
15:47:49 2008
@@ -49,12 +49,12 @@
     in megabytes (calculated approx. as MemFree+Cached?)
 
     Activate with
-       plugin.activate('idlebar.system.procstats',level=20) for defaults or
-       plugin.activate('idlebar.system.procstats',level=20,args=(Mem,Cpu,Prec))
-      where
-       Mem:  Draw memfree  (default=1, -1 to disable)
-       Cpu:  Draw cpuusage (default=1, -1 to disable)
-       Prec: Precision used when drawing cpu usage (default=1)
+    | plugin.activate('idlebar.system.procstats',level=20) for defaults or
+    | plugin.activate('idlebar.system.procstats',level=20,args=(Mem,Cpu,Prec))
+    where
+        - Mem:  Draw memfree  (default=1, -1 to disable)
+        - Cpu:  Draw cpuusage (default=1, -1 to disable)
+        - Prec: Precision used when drawing cpu usage (default=1)
     """
     def __init__(self,Mem=1,Cpu=1,Prec=1):
         IdleBarPlugin.__init__(self)
@@ -172,11 +172,9 @@
     Displays sensor temperature information (cpu,case) and memory-stats.
 
     Activate with:
-       plugin.activate('idlebar.system.sensors', level=40,
-              args=('cpusensor', 'casesensor', 'meminfo'))
-       plugin.activate('idlebar.system.sensors', level=40,
-              args=(('cpusensor','compute expression'),
-                    ('casesensor','compute_expression'), 'meminfo'))
+    | plugin.activate('idlebar.system.sensors', level=40, args=('cpusensor', 
'casesensor', 'meminfo'))
+    | plugin.activate('idlebar.system.sensors', level=40, 
args=(('cpusensor','compute expression'),
+    |     ('casesensor','compute_expression'), 'meminfo'))
 
     cpu and case sensor are the corresponding lm_sensors : this should be
     temp1, temp2 or temp3. defaults to temp3 for cpu and temp2 for case

Modified: branches/rel-1-7/freevo/src/plugins/idlebar/transcode.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/idlebar/transcode.py    (original)
+++ branches/rel-1-7/freevo/src/plugins/idlebar/transcode.py    Thu Feb 21 
15:47:49 2008
@@ -54,8 +54,9 @@
     """
     Shows the status of the current encoding job
 
-    Activate with:
-    | plugin.activate('idlebar.transcode')
+    Activate with::
+
+        | plugin.activate('idlebar.transcode')
     """
 
     def __init__(self):
@@ -122,20 +123,24 @@
         """
         Get the progress & pass information of the job currently encoding.
 
-        This call returns False if no job is currently encoding (fx the queue 
is not active).
-        When the queue is active, this call returns a tuple of 4 values:
-            (friendlyname, status, perc, timerem)
-
         friendlyname is the friendlyname you assigned to the encoding job
-        status is the current status of the encoding job, represented by an 
integer
-            0 - Not set (this job hasn't started encoding). Never used in this 
context
-            1 - Audio pass in progress
-            2 - First (analyzing) video pass (only used in multipass encoding)
-            3 - Final video pass
-            4 - Postmerge (not used atm). Final merging or similar processing 
in progress
+
+        status is the current status of the encoding job, represented by an 
integer:
+            - 0 Not set (this job hasn't started encoding). Never used in this 
context
+            - 1 Audio pass in progress
+            - 2 First (analyzing) video pass (only used in multipass encoding)
+            - 3 Final video pass
+            - 4 Postmerge (not used atm). Final merging or similar processing 
in progress
+
         perc is the percentage completed of the current pass
-        timerem is the estimated time remaining of the current pass, formatted 
as a
-            human-readable string.
+
+        timerem is the estimated time remaining of the current pass, formatted 
as a human-readable string.
+
+        @returns:
+            False if no job is currently encoding (fx the queue is not active).
+            When the queue is active, this call returns a tuple of 4 values::
+
+                (friendlyname, status, perc, timerem)
         """
         _debug_('getprogress()', 2)
 

Modified: branches/rel-1-7/freevo/src/plugins/lcd.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/lcd.py  (original)
+++ branches/rel-1-7/freevo/src/plugins/lcd.py  Thu Feb 21 15:47:49 2008
@@ -748,9 +748,9 @@
     """
     Display context info in LCD using lcdproc daemon.
 
-    Requirements:
-       * lcdproc: installed and LCDd running. (http://lcdproc.sourceforge.net/)
-       * pylcd: installed (http://www.schwarzvogel.de/software-pylcd.shtml)
+    @requires:
+       - lcdproc: installed and LCDd running. 
U{http://lcdproc.sourceforge.net/}
+       - pylcd: installed U{http://www.schwarzvogel.de/software-pylcd.shtml}
 
     Also, your LCD dimensions must be supported. Right now it support: 4x20,
     4x40, 2x16, 2x20, 2x40. If you have one with different dimension, it will

Modified: branches/rel-1-7/freevo/src/plugins/remind.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/remind.py       (original)
+++ branches/rel-1-7/freevo/src/plugins/remind.py       Thu Feb 21 15:47:49 2008
@@ -70,9 +70,10 @@
     | REMINDERS = [ ("cmd", "name", <wrap 0|N>, "string") ]
 
     wrap should be the maximum number of columns, and string if defined would 
be used to
-    indent the output. ("/usr/bin/remind -h", "Today", 47, "Reminders for") 
should output something like:
-    Reminders for Saturday, 26th May, 2007 (today):
-        Uncle Bob birthday
+    indent the output. ("/usr/bin/remind -h", "Today", 47, "Reminders for") 
should output something like::
+
+        Reminders for Saturday, 26th May, 2007 (today):
+            Uncle Bob birthday
     """
 
     def __init__(self):
@@ -133,18 +134,19 @@
                         pad = ''
                     else:
                         pad = '   '
-                    for tmp in self.wraper(line, 
int(wrap)).rstrip('\n').split('\n'):
+                    for tmp in self.wrapper(line, 
int(wrap)).rstrip('\n').split('\n'):
                         output += [ pad + tmp ]
         else:
             output = f
         return output
 
-    # from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/148061
-    def wraper(self, text, width):
+    def wrapper(self, text, width):
         """
         A word-wrap function that preserves existing line breaks
         and most spaces in the text. Expects that existing line
-        breaks are posix newlines (\n).
+        breaks are posix newlines.
+
+        from U{http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/148061}
         """
         return reduce(lambda line, word, width=width: '%s%s%s' %
             (line,

Modified: branches/rel-1-7/freevo/src/plugins/screensaver/__init__.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/screensaver/__init__.py (original)
+++ branches/rel-1-7/freevo/src/plugins/screensaver/__init__.py Thu Feb 21 
15:47:49 2008
@@ -70,9 +70,10 @@
 
 
     def config(self):
-        return [ ('SCREENSAVER_DELAY', 300, '# of seconds to wait to start 
saver.'),
-                  ('SCREENSAVER_CYCLE_TIME', 60, '# of seconds to run a 
screensaver before starting another saver.')
-                ]
+        return [
+            ('SCREENSAVER_DELAY', 300, '# of seconds to wait to start saver.'),
+            ('SCREENSAVER_CYCLE_TIME', 60, '# of seconds to run a screensaver 
before starting another saver.')
+        ]
 
 
     def eventhandler(self, event = None, menuw=None, arg=None):
@@ -80,7 +81,7 @@
         eventhandler to handle the events. Always return False since we
         are just a listener and really can't send back True.
         """
-        _debug_("Saver saw %s" % event.name)
+        _debug_("Saver saw %s" % (event.name), 2)
         if menuw:
             self.menuw = menuw
 
@@ -94,10 +95,11 @@
             return True
 
         # gotta ignore these or video screensavers shutoff before they begin
-        if event.name == 'VIDEO_START' or event.name == 'PLAY_START' or 
event.name == 'VIDEO_END' or event.name == 'PLAY_END':
+        if event.name == 'VIDEO_START' or event.name == 'PLAY_START' or \
+            event.name == 'VIDEO_END' or event.name == 'PLAY_END':
             return False
 
-        if not event.name == 'IDENTIFY_MEDIA':
+        if plugin.isevent(event) != 'IDENTIFY_MEDIA':
             self.last_event = time.time()
 
         if self.screensaver_showing:
@@ -114,20 +116,20 @@
             rc.post_event(Event("SCREENSAVER_START"))
 
 
-    def start_saver (self):
+    def start_saver(self):
         _debug_("start screensaver")
         self.screensaver_showing = True
         if self.plugins is None:
             self.plugins = plugin.get('screensaver')
-            _debug_('Plugins =', self.plugins)
+            _debug_('plugins=%r' % (self.plugins))
         skin.clear()
         # Start Screensaver thread
         self.stop_screensaver = False
-        self.thread = threading.Thread(target =self.__run__)
+        self.thread = threading.Thread(target=self.__run__)
         self.thread.start()
 
 
-    def stop_saver (self):
+    def stop_saver(self):
         _debug_("stop screensaver")
         self.stop_screensaver = True
         self.thread.join()

Modified: branches/rel-1-7/freevo/src/plugins/vfd.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/vfd.py  (original)
+++ branches/rel-1-7/freevo/src/plugins/vfd.py  Thu Feb 21 15:47:49 2008
@@ -1,6 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 # -----------------------------------------------------------------------
-# vfd.py - use pyusb to display menus and items for Shuttles VFD
+# Shuttles VFD interface plug-in
 # -----------------------------------------------------------------------
 # $Id$
 #
@@ -124,7 +124,7 @@
     }
 
 
-'''
+"""
 layouts: dict of layouts (screens and widgets)
 Structure:
 #
@@ -152,7 +152,7 @@
        player: will be used in player mode
            tv: will be used in tv mode
 Values should match the ones supported by VFDd (man VFDd)
-'''
+"""
 layouts = { 1 : # 1 line display
             { 20 : # 20 chars per line
               # Welcome screen
@@ -254,7 +254,7 @@
                  }
 
 def get_info(item, list):
-    '''Get the information'''
+    """Get the information"""
     info = ""
 
     for l in list:
@@ -272,11 +272,11 @@
     """
     Display context info on Shuttle's VFD (Versatile Front-panel Display)
 
-    Requirements:
-       * pyusb: installed (http://pyusb.berlios.de/) with name patch as
+    @requires:
+        - pyusb: installed (http://pyusb.berlios.de/) with name patch as
                 the default module is called usb and conflicts with freevo's
                 usb plugin.
-       * pyusb-0.X.X-name.patch contrib/patches
+        -  pyusb-0.X.X-name.patch contrib/patches
 
     To activate this plugin, just put the following line at the end of your
     local_conf.py file:
@@ -290,9 +290,9 @@
     __version__          = '$Revision$'
 
     def send(self, data):
-        '''
+        """
         Send a piece of data to specified VFD device, retrying if necessary
-        '''
+        """
         attempts = 3
         while attempts > 0:
             try:
@@ -311,7 +311,7 @@
         raise e
 
     def msg(self, msgtype, *msgdata):
-        '''Prepares a message for the VFD device'''
+        """Prepares a message for the VFD device"""
         assert msgtype >= 0 and msgtype <= 0xf
         assert len(msgdata) <= 7
 
@@ -326,20 +326,20 @@
         return retval
 
     def clear(self):
-        '''Clear the display'''
+        """Clear the display"""
         self.last_message = None
         self.last_bitmask = None
         self.send(self.msg(1,1))
 
     def reset(self):
-        '''Reset the cursor position'''
+        """Reset the cursor position"""
         self.send(self.msg(1,2))
 
     def brightness(self, level=0):
         pass
 
     def split(self, s, length, maxlength):
-        '''Split a string into chunks, but no longer than maxlength'''
+        """Split a string into chunks, but no longer than maxlength"""
         if len(s) > maxlength:
             _debug_('Truncating \"%s\" longer than %d characters' % 
(s,maxlength), 2)
             s = s[:maxlength]
@@ -350,7 +350,7 @@
         return out
 
     def message(self, msgstring, cls=0):
-        '''Update the display with a string, specifying if it should be 
cleared first'''
+        """Update the display with a string, specifying if it should be 
cleared first"""
         try:
             if msgstring.__class__ == unicode:
                 msgstring = msgstring.encode('iso-8859-15')
@@ -380,7 +380,7 @@
             self.send(self.msg(9,*part))
 
     def icons(self):
-        '''Update icons to be shown'''
+        """Update icons to be shown"""
         _debug_('device=%x media=%x recording=%x running=%x muted=%x 
volume=%x' % \
             (self.device, self.media, self.recording, self.running, 
self.muted, self.volume), 2)
         self.bitmask = self.device | self.media | self.recording | 
self.running | self.muted | self.volume
@@ -391,25 +391,25 @@
         self.send(self.msg(7,pack('I', self.bitmask)))
 
     def set_device(self, device=None):
-        '''Sets the device'''
+        """Sets the device"""
         if device != None:
             self.device = device
         _debug_('device=%s, self.device=%s' % (device, self.device), 2)
 
     def set_media(self, media=None):
-        '''Indicates if a CD/DVD is in the drive'''
+        """Indicates if a CD/DVD is in the drive"""
         if media != None:
             self.media = media
         _debug_('media=%s, self.media=%s' % (media, self.media))
 
     def set_running(self, running=None):
-        '''Sets the running flag if running'''
+        """Sets the running flag if running"""
         if running != None:
             self.running = running
         _debug_('running=%s, self.running=%s' % (running, self.running), 2)
 
     def set_recording(self, recording=None):
-        '''Sets the recoring flag if recoring'''
+        """Sets the recoring flag if recoring"""
         if recording != None:
             self.recording = recording
         else:
@@ -417,7 +417,7 @@
         _debug_('recording=%s, self.recording=%s' % (recording, 
self.recording), 2)
 
     def set_mixer(self, muted=None, volume=None):
-        '''Read the mixer state'''
+        """Read the mixer state"""
         if self.mixer == None:
             return
 
@@ -432,7 +432,7 @@
         _debug_('muted=%s, self.muted=%s, volume=%s, self.volume=%s' % (muted, 
self.muted, volume, self.volume))
 
     def widget_set(self, screen, widget, value):
-        '''Set the widget text'''
+        """Set the widget text"""
         #if widget != 'clock' and widget != 'time_v1' and widget != 'time_v2' 
and widget != 'time_v3' and widget != 'animation_v':
         if widget != 'clock' and widget != 'time_v2' and widget != 'time_v3' 
and widget != 'animation_v':
             _debug_('screen=%s, widget=%s, value=%s' % (screen, widget, value))
@@ -511,20 +511,21 @@
         # There seem to exist at least two different vendor/product ID
         # combinations for the Shuttle VFD. Thus, we have to check all
         # of them, until a valid one is found.
-        #self.vendorID = 4872    # Shuttle Inc
-        #self.productID = 0003   # VFD Module
+        #self.idVendor = 4872    # Shuttle Inc
+        #self.idProduct = 0003   # VFD Module
 
-        # self.usbIDs is a list of tuples (vendorID, productID)
+        # self.usbIDs is a list of tuples (idVendor, idProduct)
         self.usbIDs = [ (0x1308, 0x0003), (0x051c, 0x0005), (0x1308, 0xc001), ]
         self.maxStringLength = 20
         self.sleepLength = 0.015
         self.vfd = None
         for bus in pyusb.busses():
             for dev in bus.devices:
-                for (self.vendorID, self.productID) in self.usbIDs:
-                    if dev.idVendor == self.vendorID and dev.idProduct == 
self.productID:
+                for (self.idVendor, self.idProduct) in self.usbIDs:
+                    if dev.idVendor == self.idVendor and dev.idProduct == 
self.idProduct:
                         self.vfd = dev.open()
                         _debug_('Found VFD on bus %s at device %s' % 
(bus.dirname,dev.filename), DINFO)
+                        break
 
         if not self.vfd:
             _debug_("Cannot find VFD device", DERROR)
@@ -806,17 +807,17 @@
         elif event == 'SEEK':
             self.set_running((event.arg < 0 and Rewind) or FastForward)
             update_bits = 1
-        elif event == 'PLUGIN_EVENT IDENTIFY_MEDIA':
-            media = event.arg[0]
-            self.set_media((hasattr(media.item, 'type') and Clock) or 0)
-            update_bits = 1
         elif event == 'VIDEO_START':
             self.set_running(Play)
             update_bits = 1
         elif event == 'VIDEO_END':
             self.set_running(Stop)
             update_bits = 1
-        elif event == 'PLUGIN_EVENT USB':
+        elif plugin.isevent(event) == 'IDENTIFY_MEDIA':
+            media = event.arg[0]
+            self.set_media((hasattr(media.item, 'type') and Clock) or 0)
+            update_bits = 1
+        elif plugin.isevent(event) == 'USB':
             pass
         elif event == 'FUNCTION_CALL':
             pass
@@ -826,6 +827,8 @@
             pass
         elif event == 'TOGGLE_OSD':
             pass
+        elif event == 'MENU_PROCESS_END':
+            pass
         elif event == 'MENU_UP':
             pass
         elif event == 'MENU_DOWN':

Modified: branches/rel-1/freevo/src/plugins/buttonbar.py
==============================================================================
--- branches/rel-1/freevo/src/plugins/buttonbar.py      (original)
+++ branches/rel-1/freevo/src/plugins/buttonbar.py      Thu Feb 21 15:47:49 2008
@@ -1,6 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 # -----------------------------------------------------------------------
-# buttonbar.py-ButtonBar plugin
+# ButtonBar plug-in
 # -----------------------------------------------------------------------
 # $Id$
 #

Modified: branches/rel-1/freevo/src/plugins/vfd.py
==============================================================================
--- branches/rel-1/freevo/src/plugins/vfd.py    (original)
+++ branches/rel-1/freevo/src/plugins/vfd.py    Thu Feb 21 15:47:49 2008
@@ -1,6 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 # -----------------------------------------------------------------------
-# vfd.py - use pyusb to display menus and items for Shuttles VFD
+# Shuttles VFD interface plug-in
 # -----------------------------------------------------------------------
 # $Id$
 #

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to