From: Alexander Schmidt Date: Mon, 26 Oct 2020 22:34:55 +0000 (+0100) Subject: fixing bunch cache dir passing X-Git-Url: http://git.treefish.org/~alex/photosort.git/commitdiff_plain/980f757c6edacec24d90e73c046d513b9d22d15e?ds=sidebyside fixing bunch cache dir passing --- diff --git a/src/bunch.py b/src/bunch.py index 2b98734..5bc3edd 100644 --- a/src/bunch.py +++ b/src/bunch.py @@ -14,7 +14,7 @@ class Bunch: 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 = [] @@ -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'], - os.path.join(cfg['cache_dir'], "%d.db" % idx)), + os.path.join(cache_dir, "%d.db" % idx)), src_dir_cfg['cleanup'] ) ) diff --git a/src/photosort-daemon.py b/src/photosort-daemon.py index e345b83..523d8cf 100755 --- a/src/photosort-daemon.py +++ b/src/photosort-daemon.py @@ -39,7 +39,7 @@ with open(args.config_file) as f: 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: