X-Git-Url: https://code.delx.au/bg-scripts/blobdiff_plain/5e2988d945dc5b6dbb185bd8a32ac14dd0732b2f..8a71690dcf83024e1fdc71530a0c0c5483c3e243:/bin/randombg.py diff --git a/bin/randombg.py b/bin/randombg.py index 57d0899..f47d684 100755 --- a/bin/randombg.py +++ b/bin/randombg.py @@ -190,7 +190,7 @@ class FolderRandomFileList(BaseFileList): class Cycler(object): - def __init__(self, options, paths): + def init(self, options, paths): self.filelist = self.find_files(options, paths) if not self.filelist.is_empty(): error("No images were found. Exiting...") @@ -298,8 +298,10 @@ class Listener(asyncore.dispatcher): def do_server(options, paths): try: try: - cycler = Cycler(options, paths) + cycler = Cycler() listener = Listener(options.socket_filename, cycler) + # Initialisation of Cycler delayed so we grab the socket quickly + cycler.init(options, paths) asyncsched.loop() except KeyboardInterrupt: print