def __init__(self): """Loads & saves config file to file-system.""" self.config_dir = os.path.join(os.getcwd(), settings.CONFIG_DATA_FOLDER) if not os.path.exists(self.config_dir): log.debug("Creating config dir") os.mkdir(self.config_dir) log.debug("Config Dir: %s", self.config_dir) self.filename = os.path.join(self.config_dir, settings.CONFIG_FILE_USER) log.debug("Config DB: %s", self.filename) self.db = JSONStore(self.filename) self.count = 0 self._load_db()
def __init__(self): """Loads & saves config file to file-system. Args: config_dir (str): Path to directory where config will be stored """ self.config_dir = os.path.join(os.getcwd(), settings.CONFIG_DATA_FOLDER) if not os.path.exists(self.config_dir): log.info('Creating config dir') os.mkdir(self.config_dir) log.debug('Config Dir: %s', self.config_dir) self.filename = os.path.join(self.config_dir, settings.CONFIG_FILE_USER) log.debug('Config DB: %s', self.filename) self.db = JSONStore(self.filename) self.sync_threshold = 3 self.count = 0 self._load_db()