From 8a71690dcf83024e1fdc71530a0c0c5483c3e243 Mon Sep 17 00:00:00 2001 From: James Bunton Date: Wed, 2 Jul 2008 02:36:10 +1000 Subject: [PATCH] RandomBG: Make server grab socket faster. --- bin/randombg.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 -- 2.39.2