Ejemplo n.º 1
0
    def setup_data(self):
        # This ensures that data_dir is prepared and all the directories are in
        # their place. This is necessary so that we can later copy in our test
        # files.

        assert (os.path.isdir(self.data_dir_path))
        self.copy_to_data("config.ini")

        # we do this to create all the necessary directories
        fake_config = Configuration()
        fake_config.load(os.path.join(self.data_dir_path, "config.ini"))
        fake_config.prepare_dirs()
Ejemplo n.º 2
0
    def __init__(self, config_file):
        self. async = async .AsyncManager()

        logging.info("Loading configuration from '%s'.", config_file)
        self.config = Configuration()
        self.config.load(config_file)
        self.config.autodetect_tool_paths()
        self.config.autodetect_content_paths()
        self.config.prepare_dirs()

        self.tasks = dict()
        self.tasks_lock = threading.Lock()
        # a set of tasks that have already been scheduled, we keep this so that
        # we don't schedule a task twice in a row
        self.tasks_scheduled = set()

        self.update_wait_cond = threading.Condition()