-#!/usr/bin/env python
+#!/usr/bin/env python2
VERSION = "2.1"
self.cache_filename = options.cache_filename
logging.debug("Initialising wallchanger")
- wallchanger.init(options.background_colour, options.permanent, options.convert)
+ wallchanger.init(options.background_colour, options.convert)
logging.debug("Initialising file list")
if options.all_random:
try:
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.connect(options.socket_filename)
- print >>sys.stderr, "Server is already running! Will do nothing"
- return
- except:
+ print >>sys.stderr, "Server is already running! Sending exit command."
+ sock = sock.makefile()
+ sock.write("cmd exit\n")
+ sock.close()
+ except Exception, e:
pass
try:
except OSError:
pass
+ cycler = Cycler()
+ listener = Listener(options.socket_filename, cycler)
+ # Initialisation of Cycler delayed so we grab the socket quickly
+ cycler.init(options, paths)
try:
- cycler = Cycler()
- listener = Listener(options.socket_filename, cycler)
- # Initialisation of Cycler delayed so we grab the socket quickly
- cycler.init(options, paths)
- try:
- asyncsched.loop()
- except KeyboardInterrupt:
- print
- cycler.finish()
- finally:
- # Make sure that the socket is cleaned up
- try:
- os.unlink(options.socket_filename)
- except OSError:
- pass
+ asyncsched.loop()
+ except KeyboardInterrupt:
+ print
+ cycler.finish()
def do_client(options, args):
if len(args) == 0:
"\n(client) %prog [options] [next|prev|rescan|reload|pause] [...]"
"\nThe first instance to be run will be the server.\n"
)
- parser.add_option("-p", "--permanent",
- action="store_true", dest="permanent", default=False,
- help="Make the background permanent. Note: This will cause all machines logged in with this account to simultaneously change background [Default: %default]")
parser.add_option("-v", '-d', "--verbose", "--debug",
action="count", dest="verbose", default=0,
help="Make the louder (good for debugging, or those who are curious)")