X-Git-Url: http://git.treefish.org/~alex/photosort.git/blobdiff_plain/f74cea71b4539995483ec2393f22d7592d03632b..1befba228a239882adefcb7b92eb5f8f83178d62:/src/bunch.py?ds=inline diff --git a/src/bunch.py b/src/bunch.py index 228131a..1c3fe71 100644 --- a/src/bunch.py +++ b/src/bunch.py @@ -1,4 +1,5 @@ import logging +import os import time import threading @@ -13,17 +14,18 @@ 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 = [] for src_dir_cfg in cfg['src_dirs']: + reg_db = os.path.join(cache_dir, "reg_%d_%d.db" % (idx, source_idx)) self._sources.append( Bunch.TriggeredSource( source_idx, DirTrigger(src_dir_cfg['path'], src_dir_cfg['cool_time'], src_dir_cfg['max_time']), - Migrator(src_dir_cfg['path'], cfg['dst_dir']['path']), + Migrator(src_dir_cfg['path'], cfg['dst_dir']['path'], reg_db), src_dir_cfg['cleanup'] ) )