X-Git-Url: https://code.delx.au/bg-scripts/blobdiff_plain/b63d8c626ddcc134450c08f137a23a35dede0207..b9fbe7ae464bd55ce910929bb678f440c72cb121:/randombg.py diff --git a/randombg.py b/randombg.py index 3deac9c..a259e1e 100755 --- a/randombg.py +++ b/randombg.py @@ -7,7 +7,12 @@ import asyncore, asynchat, socket import os, os.path, random, sys, time from optparse import OptionParser import logging -logging.basicConfig(format="%(levelname)s: %(message)s") +try: + logging.basicConfig(format="%(levelname)s: %(message)s") +except TypeError: +# Python 2.3's logging.basicConfig does not support parameters + logging.basicConfig() + try: import cPickle as pickle except ImportError: @@ -18,7 +23,7 @@ try: import asyncsched import wallchanger except ImportError, e: - logging.critical("Missing libraries! Exiting...") + logging.critical("Missing libraries! Exiting...", exc_info=1) sys.exit(1) @@ -147,7 +152,7 @@ class AllRandomFileList(BaseFileList): def store_cache(self, filename): try: fd = open(filename, 'wb') - pickle.dump(obj = self, file = fd, protocol = 2) + pickle.dump(self, fd, 2) logging.debug("Cache successfully stored") except Exception, e: logging.warning("Storing cache", exc_info=1) @@ -240,7 +245,7 @@ class Cycler(object): self.history_filename = options.history_filename logging.debug("Initialising wallchanger") - wallchanger.init(options.background_colour, options.permanent) + wallchanger.init(options.background_colour, options.permanent, options.convert) logging.debug("Initialising file list") if options.all_random: