]> code.delx.au - bg-scripts/commitdiff
Fixed WallChanger to fall back on getNextRandomImage() if getCurrentImage() is not...
authorJames Bunton <jamesbunton@delx.net.au>
Tue, 15 Apr 2008 06:10:35 +0000 (16:10 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Tue, 15 Apr 2008 06:10:35 +0000 (16:10 +1000)
lib/WallChanger.py

index 060fe63458334d986fb482d9c5210b349dfa09ac..1281add7c2e744aa18bcc9684c49ad8b648fed1e 100644 (file)
@@ -2,6 +2,7 @@
 
 import commands, sys, os, os.path, subprocess, time
 from GregDebug import debug, setDebugLevel, DEBUG_LEVEL_DEBUG, DEBUG_LEVEL_LOW, DEBUG_LEVEL_MEDIUM, DEBUG_LEVEL_HIGH, DEBUG_INCREMENT
+import FileLists
 
 import python24_adapter # NB: Must be imported before collections
 import collections
@@ -80,8 +81,11 @@ class __BaseChanger(object):
                return self.changeTo(file) and self.callChained(file)
        
        def cycleReload(self):
-               file = self.filelist.getCurrentImage()
-               return self.changeTo(file) and self.callChained(file)
+               try:
+                       file = self.filelist.getCurrentImage()
+                       return self.changeTo(file) and self.callChained(file)
+               except FileLists.FileListNotImplemented:
+                       return self.cycleNext()
 
 
 class __WMakerChanger(__BaseChanger):