cesarp.eplus_adapter.RelativeAuxiliaryFilesHandler module

class cesarp.eplus_adapter.RelativeAuxiliaryFilesHandler.RelativeAuxiliaryFilesHandler[source]

Bases: object

Copies exactly one time each file which is added by add_file() to the destination folder. If a file with the same name, but another source location is added, an exception is thrown. Instance of this class is multithreading save, as access to r/w member self.files_copied is protected with a lock.


Use set_destination to initialize. Setting folder path after initialization is necessary to be able to create an instance of this class handled by multiprocessing Manager, but not needing the folder path in the global environment.




path of the file in the destination folder, relative to the parant folder passed in the object initialization

set_destination(parent_folder, subfolder_name)[source]

This method should only be called once! :param parent_folder: parent folder, profile pathes returned by add_file() will be relative to this parent folder :param subfolder_name: name of folder where files should be stored to, folder will be created as a child of parent_folder :return: nothing