Author: duncan
Date: Sat Mar  8 16:30:05 2008
New Revision: 10488

Log:
Renamed the SHUTDOWN variables


Modified:
   branches/rel-1/freevo/contrib/kommander/kmdrfreevo.kmdr
   branches/rel-1/freevo/contrib/ps3/local_conf.py
   branches/rel-1/freevo/freevo_config.py
   branches/rel-1/freevo/local_conf.py.example
   branches/rel-1/freevo/src/helpers/convert_config.py
   branches/rel-1/freevo/src/plugins/autoshutdown.py
   branches/rel-1/freevo/src/plugins/shutdown.py

Modified: branches/rel-1/freevo/contrib/kommander/kmdrfreevo.kmdr
==============================================================================
--- branches/rel-1/freevo/contrib/kommander/kmdrfreevo.kmdr     (original)
+++ branches/rel-1/freevo/contrib/kommander/kmdrfreevo.kmdr     Sat Mar  8 
16:30:05 2008
@@ -74,9 +74,9 @@
 
 ### ShutDown and Reboot
 CONFIRM_SHUTDOWN       = @CONFIRM_SHUTDOWN.checked
-ENABLE_SHUTDOWN_SYS    = @ENABLE_SHUTDOWN_SYS.checked
-SHUTDOWN_SYS_CMD = '@SHUTDOWN_SYS_CMD.text'
-RESTART_SYS_CMD  = '@RESTART_SYS_CMD.text'
+SYS_SHUTDOWN_ENABLE    = @SYS_SHUTDOWN_ENABLE.checked
+SYS_SHUTDOWN_CMD = '@SYS_SHUTDOWN_CMD.text'
+SYS_RESTART_CMD  = '@SYS_RESTART_CMD.text'
 
 ### Network-Remote
 REMOTE_CONTROL_HOST    = '@REMOTE_CONTROL_HOST.text'
@@ -1635,7 +1635,7 @@
                 </widget>
                 <widget class="LineEdit">
                     <property name="name">
-                        <cstring>RESTART_SYS_CMD</cstring>
+                        <cstring>SYS_RESTART_CMD</cstring>
                     </property>
                     <property name="geometry">
                         <rect>
@@ -1651,7 +1651,7 @@
                 </widget>
                 <widget class="LineEdit">
                     <property name="name">
-                        <cstring>SHUTDOWN_SYS_CMD</cstring>
+                        <cstring>SYS_SHUTDOWN_CMD</cstring>
                     </property>
                     <property name="geometry">
                         <rect>
@@ -1667,7 +1667,7 @@
                 </widget>
                 <widget class="CheckBox">
                     <property name="name">
-                        <cstring>ENABLE_SHUTDOWN_SYS</cstring>
+                        <cstring>SYS_SHUTDOWN_ENABLE</cstring>
                     </property>
                     <property name="geometry">
                         <rect>

Modified: branches/rel-1/freevo/contrib/ps3/local_conf.py
==============================================================================
--- branches/rel-1/freevo/contrib/ps3/local_conf.py     (original)
+++ branches/rel-1/freevo/contrib/ps3/local_conf.py     Sat Mar  8 16:30:05 2008
@@ -60,7 +60,7 @@
 
 # START_FULLSCREEN_X = 0               # Start in fullscreen mode if using x11 
or xv.
 
-SHUTDOWN_CONFIRM   = 0                 # ask before shutdown
+SYS_SHUTDOWN_CONFIRM   = 0                 # ask before shutdown
 
 #
 # Physical ROM drives, multiple ones can be specified
@@ -91,12 +91,12 @@
 #
 # Perform a whole system shutdown at SHUTDOWN! Useful for standalone boxes.
 #
-# ENABLE_SHUTDOWN_SYS = 0
+# SYS_SHUTDOWN_ENABLE = 0
 #
 # Command to execute to shutdown the system
 #
-# SHUTDOWN_SYS_CMD = "sudo shutdown -h now"
-# RESTART_SYS_CMD = "sudo shutdown -r now"
+# SYS_SHUTDOWN_CMD = "sudo shutdown -h now"
+# SYS_RESTART_CMD = "sudo shutdown -r now"
 
 # ======================================================================
 # AUTOSHUTDOWN CONFIGURATION

Modified: branches/rel-1/freevo/freevo_config.py
==============================================================================
--- branches/rel-1/freevo/freevo_config.py      (original)
+++ branches/rel-1/freevo/freevo_config.py      Sat Mar  8 16:30:05 2008
@@ -349,8 +349,12 @@
     (5.23,
      ''' Added XMLTV_TIMEZONE to allow the time zone to be specified
      Added OSD_X11_CURSORS to allow custom cursor to be set, stops xine 
showing a cursor
-     Changes TV_RECORD_SCHEDULE to be a pickle file, this will delete existing 
favorites
+     Changed TV_RECORD_SCHEDULE to be a pickle file, this will delete existing 
favorites
      Added TV_RECORD_FAVORITES and TV_RECORD_FAVORITES_LIST to keep favorites 
separate
+     Changed SHUTDOWN_CONFIRM to SYS_SHUTDOWN_CONFIRM for consistency
+     Changed SHUTDOWN_SYS_CMD to SYS_SHUTDOWN_CMD for consistency
+     Changed RESTART_SYS_CMD to SYS_RESTART_CMD for consistency
+     Changed SHUTDOWN_SYS_ENABLE to SYS_SHUTDOWN_ENABLE for consistency
      '''),
 ]
 
@@ -425,14 +429,14 @@
 # Set to 0 for no confirmation, set to 1 to show a confirm dialog
 # (OK preselected), set to 2 to show a confirm dialog (Cancel preselected)
 #
-SHUTDOWN_CONFIRM = 1                  # ask before shutdown
+SYS_SHUTDOWN_CONFIRM = 1                  # ask before shutdown
 
-SHUTDOWN_SYS_CMD = 'shutdown -h now'  # set this to 'sudo shutdown -h now' if
+SYS_SHUTDOWN_CMD = 'shutdown -h now'  # set this to 'sudo shutdown -h now' if
                                       # you don't have the permissions to 
shutdown
 
-RESTART_SYS_CMD  = 'shutdown -r now'  # like SHUTDOWN_SYS_CMD, only for reboot
+SYS_RESTART_CMD  = 'shutdown -r now'  # like SYS_SHUTDOWN_CMD, only for reboot
 
-SHUTDOWN_SYS_ENABLE = 0  # Performs a whole system shutdown at SHUTDOWN!
+SYS_SHUTDOWN_ENABLE = 0  # Performs a whole system shutdown at SHUTDOWN!
                          # For standalone boxes.
 
 
@@ -472,7 +476,7 @@
 
 # -- autoshutdown menu item configuration --
 
-# SHUTDOWN_CONFIRM
+# SYS_SHUTDOWN_CONFIRM
 # Set to True to popup dialog boxes for confirmation.
 # this applies to menu items only.
 AUTOSHUTDOWN_CONFIRM=True

Modified: branches/rel-1/freevo/local_conf.py.example
==============================================================================
--- branches/rel-1/freevo/local_conf.py.example (original)
+++ branches/rel-1/freevo/local_conf.py.example Sat Mar  8 16:30:05 2008
@@ -76,7 +76,7 @@
 
 # START_FULLSCREEN_X = 0               # Start in fullscreen mode if using x11 
or xv.
 
-# SHUTDOWN_CONFIRM   = 1               # ask before shutdown
+# SYS_SHUTDOWN_CONFIRM   = 1               # ask before shutdown
 
 #
 # Physical ROM drives, multiple ones can be specified
@@ -104,12 +104,12 @@
 #
 # Perform a whole system shutdown at SHUTDOWN! Useful for standalone boxes.
 #
-# SHUTDOWN_SYS_ENABLE = 0
+# SYS_SHUTDOWN_ENABLE = 0
 #
 # Command to execute to shutdown the system
 #
-# SHUTDOWN_SYS_CMD = "sudo shutdown -h now"
-# RESTART_SYS_CMD = "sudo shutdown -r now"
+# SYS_SHUTDOWN_CMD = "sudo shutdown -h now"
+# SYS_RESTART_CMD = "sudo shutdown -r now"
 
 # ======================================================================
 # AUTOSHUTDOWN CONFIGURATION
@@ -125,7 +125,7 @@
 
 # -- autoshutdown menu item configuration --
 
-# SHUTDOWN_CONFIRM
+# SYS_SHUTDOWN_CONFIRM
 # Set to True to popup dialog boxes for confirmation.
 # this applies to menu items only.
 # AUTOSHUTDOWN_CONFIRM = True

Modified: branches/rel-1/freevo/src/helpers/convert_config.py
==============================================================================
--- branches/rel-1/freevo/src/helpers/convert_config.py (original)
+++ branches/rel-1/freevo/src/helpers/convert_config.py Sat Mar  8 16:30:05 2008
@@ -121,6 +121,11 @@
     'audio\.playlist': 'audio.playlists',
     'TV_TV_': 'TV_',
     'MIXER_MIXER_': 'MIXER_',
+    'SHUTDOWN_CONFIRM': 'SYS_SHUTDOWN_CONFIRM',
+    'SHUTDOWN_SYS_CMD': 'SYS_SHUTDOWN_CMD',
+    'RESTART_SYS_CMD': 'SYS_RESTART_CMD',
+    'SHUTDOWN_SYS_ENABLE': 'SYS_SHUTDOWN_ENABLE',
+    'AUTOSYS_SHUTDOWN_CONFIRM': 'AUTOSHUTDOWN_CONFIRM',
 }
 
 def help():

Modified: branches/rel-1/freevo/src/plugins/autoshutdown.py
==============================================================================
--- branches/rel-1/freevo/src/plugins/autoshutdown.py   (original)
+++ branches/rel-1/freevo/src/plugins/autoshutdown.py   Sat Mar  8 16:30:05 2008
@@ -81,7 +81,7 @@
     | plugin.activate('autoshutdown',level=90)
 
     Configuration:
-    | SHUTDOWN_SYS_ENABLE = 1
+    | SYS_SHUTDOWN_ENABLE = 1
     | AUTOSHUTDOWN_METHOD = 'acpi|nvram'
     | AUTOSHUTDOWN_WAKEUP_CMD = PATH/TO/THE/WAKEUP_SCRIPT
     | AUTOSHUTDOWN_DEFAULT_WAKEUP_TIME = '13:00'
@@ -123,7 +123,7 @@
 
     def config(self):
         return [
-            ('SHUTDOWN_SYS_ENABLE', 1, 'System shutdown enabled'),
+            ('SYS_SHUTDOWN_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'),
@@ -504,14 +504,14 @@
     if (action == Shutdown.RESTART_SYSTEM):
         _debug_('restart system')
         __cleanup_freevo()
-        __syscall(config.RESTART_SYS_CMD, config.AUTOSHUTDOWN_PRETEND)
+        __syscall(config.SYS_RESTART_CMD, config.AUTOSHUTDOWN_PRETEND)
         # wait until the system halts/reboots
         while 1:
             time.sleep(1)
     elif (action == Shutdown.SHUTDOWN_SYSTEM):
         _debug_('shutdown system')
         __cleanup_freevo()
-        __syscall(config.SHUTDOWN_SYS_CMD, config.AUTOSHUTDOWN_PRETEND)
+        __syscall(config.SYS_SHUTDOWN_CMD, config.AUTOSHUTDOWN_PRETEND)
         # wait until the system halts/reboots
         while 1:
             time.sleep(1)
@@ -593,7 +593,7 @@
     """
     Performs necessary actions for freevo shutdown
     """
-    _debug_('__cleanup_freevo()', 2)
+    _debug_('__cleanup_freevo()', 1)
     import osd
     import plugin
     import rc
@@ -606,24 +606,24 @@
             # handler, but we are dead already.
             sys.exit(0)
         osd.clearscreen(color=osd.COL_BLACK)
-        osd.drawstringframed(
-            _('shutting down...'),
-            0, 0, osd.width, osd.height,
-            osd.getfont(config.OSD_DEFAULT_FONTNAME,
-            config.OSD_DEFAULT_FONTSIZE),
-            fgcolor=osd.COL_ORANGE,
-            align_h='center', align_v='center'
-        )
+        osd.drawstringframed(_('shutting down...'), 0, 0, osd.width, 
osd.height,
+            osd.getfont(config.OSD_DEFAULT_FONTNAME, 
config.OSD_DEFAULT_FONTSIZE),
+            fgcolor=osd.COL_ORANGE, align_h='center', align_v='center')
         osd.update()
         time.sleep(0.5)
     # shutdown all daemon plugins
+    _debug_('plugin.shutdown()', 1)
     plugin.shutdown()
     # shutdown registered callbacks
+    _debug_('rc.shutdown()', 1)
     rc.shutdown()
     if not config.HELPER:
         # shutdown the screen
+        _debug_('osd.clearscreen(color=osd.COL_BLACK)', 1)
         osd.clearscreen(color=osd.COL_BLACK)
+        _debug_('osd.shutdown()', 1)
         osd.shutdown()
+        _debug_('raise SystemExit', 1)
         raise SystemExit
 
 
@@ -634,9 +634,9 @@
     @returns: True/False
     """
     _debug_('__is_recordserver_remote()', 2)
-    if len(glob.glob('/var/run/recordserver*.pid'))>0:
+    if len(glob.glob('/var/run/recordserver*.pid')) > 0:
         return False
-    elif len(glob.glob('/tmp/recordserver*.pid'))>0:
+    elif len(glob.glob('/tmp/recordserver*.pid')) > 0:
         return False
     else:
         return True
@@ -668,7 +668,7 @@
         raise ExNoRecordServer
     else:
         scheduled_programs = []
-        if schedule:
+        if status:
             proglist = schedule.getProgramList().values()
             if (index + 1) > len(proglist):
                 raise ExIndexNotAvailable

Modified: branches/rel-1/freevo/src/plugins/shutdown.py
==============================================================================
--- branches/rel-1/freevo/src/plugins/shutdown.py       (original)
+++ branches/rel-1/freevo/src/plugins/shutdown.py       Sat Mar  8 16:30:05 2008
@@ -62,30 +62,30 @@
 
     osd.clearscreen(color=osd.COL_BLACK)
     osd.drawstringframed(_('shutting down...'), 0, 0, osd.width, osd.height,
-                         osd.getfont(config.OSD_DEFAULT_FONTNAME,
-                                     config.OSD_DEFAULT_FONTSIZE),
-                         fgcolor=osd.COL_ORANGE, align_h='center', 
align_v='center')
+        osd.getfont(config.OSD_DEFAULT_FONTNAME, config.OSD_DEFAULT_FONTSIZE),
+        fgcolor=osd.COL_ORANGE, align_h='center', align_v='center')
     osd.update()
     time.sleep(0.5)
 
     if argshutdown or argrestart:
         # shutdown dual head for mga
         if config.CONF.display == 'mga':
-            os.system('%s runapp matroxset -f /dev/fb1 -m 0' % \
-                      os.environ['FREEVO_SCRIPT'])
+            os.system('%s runapp matroxset -f /dev/fb1 -m 0' % 
os.environ['FREEVO_SCRIPT'])
             time.sleep(1)
-            os.system('%s runapp matroxset -f /dev/fb0 -m 1' % \
-                      os.environ['FREEVO_SCRIPT'])
+            os.system('%s runapp matroxset -f /dev/fb0 -m 1' % 
os.environ['FREEVO_SCRIPT'])
             time.sleep(1)
 
+        _debug_('mga:plugin.shutdown()', 1)
         plugin.shutdown()
+        _debug_('mga:rc.shutdown()', 1)
         rc.shutdown()
+        _debug_('mga:osd.shutdown()', 1)
         osd.shutdown()
 
         if argshutdown and not argrestart:
-            os.system(config.SHUTDOWN_SYS_CMD)
+            os.system(config.SYS_SHUTDOWN_CMD)
         elif argrestart and not argshutdown:
-            os.system(config.RESTART_SYS_CMD)
+            os.system(config.SYS_RESTART_CMD)
         # let freevo be killed by init, looks nicer for mga
         while 1:
             time.sleep(1)
@@ -96,21 +96,27 @@
     #
 
     # Shutdown any daemon plugins that need it.
+    _debug_('plugin.shutdown()', 1)
     plugin.shutdown()
 
     # Shutdown all children still running
+    _debug_('rc.shutdown()', 1)
     rc.shutdown()
 
     # SDL must be shutdown to restore video modes etc
+    _debug_('osd.clearscreen(color=osd.COL_BLACK)', 1)
     osd.clearscreen(color=osd.COL_BLACK)
+    _debug_('osd.shutdown()', 1)
     osd.shutdown()
 
+    _debug_('config.shutdown()', 1)
     config.shutdown()
 
     if exit:
         # realy exit, we are called by the signal handler
         sys.exit(0)
 
+    _debug_('%s stop' % os.environ['FREEVO_SCRIPT'], 1)
     os.system('%s stop' % os.environ['FREEVO_SCRIPT'])
 
     # Just wait until we're dead. SDL cannot be polled here anyway.
@@ -124,6 +130,7 @@
     Item for shutdown
     """
     def __init__(self, parent=None):
+        _debug_('ShutdownItem.__init__(parent=%r)' % (parent,), 1)
         Item.__init__(self, parent, skin_type='shutdown')
         self.menuw = None
 
@@ -132,7 +139,8 @@
         """
         return a list of actions for this item
         """
-        if config.SHUTDOWN_CONFIRM:
+        _debug_('ShutdownItem.actions()', 1)
+        if config.SYS_SHUTDOWN_CONFIRM:
             items = [ (self.confirm_freevo, _('Shutdown Freevo') ),
                           (self.confirm_system, _('Shutdown system') ),
                           (self.confirm_system_restart, _('Restart system') ) ]
@@ -140,7 +148,7 @@
             items = [ (self.shutdown_freevo, _('Shutdown Freevo') ),
                           (self.shutdown_system, _('Shutdown system') ),
                           (self.shutdown_system_restart, _('Restart system') ) 
]
-        if config.SHUTDOWN_SYS_ENABLE:
+        if config.SYS_SHUTDOWN_ENABLE:
             items = [ items[1], items[0], items[2] ]
 
         return items
@@ -150,35 +158,40 @@
         """
         Pops up a ConfirmBox.
         """
+        _debug_('confirm_freevo(arg=%r, menuw=%r)' % (arg, menuw), 1)
         self.menuw = menuw
         what = _('Do you really want to shut down Freevo?')
         ConfirmBox(text=what, handler=self.shutdown_freevo,
-                   default_choice=config.SHUTDOWN_CONFIRM-1).show()
+                   default_choice=config.SYS_SHUTDOWN_CONFIRM-1).show()
 
 
     def confirm_system(self, arg=None, menuw=None):
         """
         Pops up a ConfirmBox.
         """
+        _debug_('confirm_system(arg=%r, menuw=%r)' % (arg, menuw), 1)
         self.menuw = menuw
         what = _('Do you really want to shut down the system?')
         ConfirmBox(text=what, handler=self.shutdown_system,
-                   default_choice=config.SHUTDOWN_CONFIRM-1).show()
+                   default_choice=config.SYS_SHUTDOWN_CONFIRM-1).show()
 
 
     def confirm_system_restart(self, arg=None, menuw=None):
         """
         Pops up a ConfirmBox.
         """
+        _debug_('confirm_system_restart(arg=%r, menuw=%r)' % (arg, menuw), 1)
         self.menuw = menuw
         what = _('Do you really want to restart the system?')
         ConfirmBox(text=what, handler=self.shutdown_system_restart,
-                   default_choice=config.SHUTDOWN_CONFIRM-1).show()
+                   default_choice=config.SYS_SHUTDOWN_CONFIRM-1).show()
+
 
     def shutdown_freevo(self, arg=None, menuw=None):
         """
         shutdown freevo, don't shutdown the system
         """
+        _debug_('shutdown_freevo(arg=%r, menuw=%r)' % (arg, menuw), 1)
         shutdown(menuw=menuw, argshutdown=False, argrestart=False)
 
 
@@ -186,26 +199,24 @@
         """
         shutdown the complete system
         """
+        _debug_('shutdown_system(arg=%r, menuw=%r)' % (arg, menuw), 1)
         shutdown(menuw=menuw, argshutdown=True, argrestart=False)
 
+
     def shutdown_system_restart(self, arg=None, menuw=None):
         """
         restart the complete system
         """
+        _debug_('shutdown_system_restart(arg=%r, menuw=%r)' % (arg, menuw), 1)
         shutdown(menuw=menuw, argshutdown=False, argrestart=True)
 
 
 
-
-
-#
-# the plugins defined here
-#
-
 class PluginInterface(MainMenuPlugin):
     """
     Plugin to shutdown Freevo from the main menu
     """
 
     def items(self, parent):
+        _debug_('items(parent=%r)' % (parent,), 1)
         return [ ShutdownItem(parent) ]

-------------------------------------------------------------------------
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