diff --git a/processor/_main.py b/processor/_main.py index 1f5c76f..c591c24 100644 --- a/processor/_main.py +++ b/processor/_main.py @@ -6,7 +6,7 @@ __all__ = ['set_data_dir', 'process'] -_data_dir = None +_data_dir: Directory | None = None def set_data_dir(data_dir): @@ -21,7 +21,9 @@ def process(option): raise ValueError('No data directory set.') if option['desinventar']['merge']: merge_controller.start_merging(_data_dir) + _data_dir.update() if option['desinventar']['slice']: slice_controller.start_slice(_data_dir) + _data_dir.update() if option['emdat']['process']: emdat_controller.start_emdat(_data_dir) diff --git a/processor/_utils/_directory.py b/processor/_utils/_directory.py index e3e2c35..09ce309 100644 --- a/processor/_utils/_directory.py +++ b/processor/_utils/_directory.py @@ -53,7 +53,7 @@ def __init__(self, path: str): self.__files: list[File] = [] self.__directories: list[Directory] = [] self.__content_names: list[str] = [] - self.__update() + self.update() def __scan_directory(self): with os.scandir(self.__path) as it: @@ -63,7 +63,7 @@ def __scan_directory(self): elif entry.is_dir(): self.__directories.append(Directory(entry.path)) - def __update(self): + def update(self): self.__files = [] self.__directories = [] self.__scan_directory() @@ -153,7 +153,7 @@ def create_subdirectory(self, directory): if os.path.exists(path): return os.makedirs(path) - self.__update() + self.update() def get_contents(self): """Returns a list of the files and subdirectories in the directory."""