def __init__(self):
self.directories = {}
+ def scan_paths(self):
+ pass
+
def add_path(self, path):
debug('Added path "%s" to the list' % path)
for dirpath, dirs, filenames in os.walk(path):
debug('Scanning "%s" for images' % dirpath)
if self.directories.has_key(dirpath):
continue
- filenames = filter_images(filenames)
+ filenames = list(filter_images(filenames))
if len(filenames):
self.directories[dirpath] = filenames
debug('Adding "%s" to "%s"' % (filenames, dirpath))
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...")
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
if options.verbose == 1:
logging.getLogger().setLevel(logging.INFO)
- print "INFO"
elif options.verbose >= 2:
logging.getLogger().setLevel(logging.DEBUG)
- print "DEBUG"
if os.path.exists(options.socket_filename):
do_client(options, args)