Author: duncan
Date: Wed Jun 13 18:59:29 2007
New Revision: 9689
Modified:
branches/rel-1/freevo/ChangeLog
branches/rel-1/freevo/src/plugins/autoshutdown.py
Log:
[ 1721638 ] Autoshutdown problems
Patch from Justin Wetherell applied
Modified: branches/rel-1/freevo/ChangeLog
==============================================================================
--- branches/rel-1/freevo/ChangeLog (original)
+++ branches/rel-1/freevo/ChangeLog Wed Jun 13 18:59:29 2007
@@ -27,6 +27,7 @@
* Updated xine video plug-in to process stdout and stderr message (F#1729603)
* Updated xmltv's use of element tree for Python-2.5 (F#1731775)
* Fixed audio channel selection for AVI files, when no id is present
(B#1731232)
+ * Fixed auto shutdown when the record server is running remotely (B#1721638)
* Fixed button bar raising an exception when using colour actions (B#1732378)
* Fixed CD cover image search because of changes to Amazon developer services
(B#1731835)
* Fixed fxd parser's setattr not working correctly in all cases (B#1728421)
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 Wed Jun 13 18:59:29 2007
@@ -33,6 +33,7 @@
import os
import time
import sys
+import glob
import commands
import config
import plugin
@@ -50,6 +51,8 @@
class ExNoRecordServer(Exception) : pass
+class ExRecordServerRemote(Exception): pass
+
class ExNoDefaultWakeup(Exception) : pass
class ExIndexNotAvailable(Exception) : pass
@@ -415,6 +418,8 @@
t = now + (config.AUTOSHUTDOWN_ALLOWED_IDLE_TIME*60) + 1
except ExNoRecordServer:
t = now + (config.AUTOSHUTDOWN_ALLOWED_IDLE_TIME*60) + 1
+ except ExRecordServerRemote:
+ t = now + (config.AUTOSHUTDOWN_ALLOWED_IDLE_TIME*60) + 1
if (t - now < 0):
raise ExRecordingInProgress
if ((t - now) <= (config.AUTOSHUTDOWN_ALLOWED_IDLE_TIME*60)):
@@ -444,6 +449,9 @@
except ExNoRecordServer:
_debug_("Record serer is down")
break
+ except ExRecordServerRemote:
+ _debug_("Record serer is remote")
+ break
except ExIndexNotAvailable:
_debug_("No more recordings available")
break
@@ -618,6 +626,21 @@
osd.clearscreen(color=osd.COL_BLACK)
osd.shutdown()
+# -----------------------------------------------------------
+# __is_recordserver_remote
+# See if the recordserver is on this local machine
+# -----------------------------------------------------------
+# Input: None
+# Result: True/False
+# -----------------------------------------------------------
+def __is_recordserver_remote():
+ if len(glob.glob('/var/run/recordserver*.pid'))>0:
+ return False
+ elif len(glob.glob('/tmp/recordserver*.pid'))>0:
+ return False
+ else:
+ return True
+
# -----------------------------------------------------------
# __get_scheduled_recording
@@ -626,11 +649,14 @@
# 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):
+ if __is_recordserver_remote():
+ raise ExRecordServerRemote
try:
- #(result, response) = record_client.updateFavoritesSchedule()
(result, schedule) = record_client.getScheduledRecordings()
except:
raise ExNoRecordServer
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog