]> git.treefish.org Git - photosort.git/commitdiff
fixing bunch cache dir passing
authorAlexander Schmidt <alex@treefish.org>
Mon, 26 Oct 2020 22:34:55 +0000 (23:34 +0100)
committerAlexander Schmidt <alex@treefish.org>
Mon, 26 Oct 2020 22:34:55 +0000 (23:34 +0100)
src/bunch.py
src/photosort-daemon.py

index 2b98734f46f5cb9fa295a959cca4b10ea96f01fc..5bc3eddc5ca49f59f2588e86d85a026911a2d057 100644 (file)
@@ -14,7 +14,7 @@ class Bunch:
             self.migrator = migrator
             self.cleanup = cleanup
 
             self.migrator = migrator
             self.cleanup = cleanup
 
-    def __init__(self, idx, cfg):
+    def __init__(self, idx, cache_dir, cfg):
         self._idx = idx
         source_idx = 1
         self._sources = []
         self._idx = idx
         source_idx = 1
         self._sources = []
@@ -25,7 +25,7 @@ class Bunch:
                     DirTrigger(src_dir_cfg['path'], src_dir_cfg['cool_time'],
                                src_dir_cfg['max_time']),
                     Migrator(src_dir_cfg['path'], cfg['dst_dir']['path'],
                     DirTrigger(src_dir_cfg['path'], src_dir_cfg['cool_time'],
                                src_dir_cfg['max_time']),
                     Migrator(src_dir_cfg['path'], cfg['dst_dir']['path'],
-                             os.path.join(cfg['cache_dir'], "%d.db" % idx)),
+                             os.path.join(cache_dir, "%d.db" % idx)),
                     src_dir_cfg['cleanup']
                 )
             )
                     src_dir_cfg['cleanup']
                 )
             )
index e345b837188b3fe5fed584630753c530a3a8bc59..523d8cfedface2fe7719d25f2a558e1031dcfa1b 100755 (executable)
@@ -39,7 +39,7 @@ with open(args.config_file) as f:
 bunch_idx = 1
 bunches = []
 for bunch_cfg in cfg['bunches']:
 bunch_idx = 1
 bunches = []
 for bunch_cfg in cfg['bunches']:
-    bunches.append( Bunch(bunch_idx, bunch_cfg) )
+    bunches.append( Bunch(bunch_idx, cfg['cache_dir'], bunch_cfg) )
     bunch_idx += 1
 
 for bunch in bunches:
     bunch_idx += 1
 
 for bunch in bunches: