def _exit(self): content = {} content['name'] = self._name content['volume'] = self._volume content['maxid'] = self._maxid content['description'] = self._description content['datetime'] = self._datetime tools.set_json_content(self._catalog_info_path, content)
def _exit(self): content = {} content['name'] = self._name content['volume'] = self._volume content['description'] = self._description content['datetime'] = self._datetime content['subdirs'] = self._subdirs tools.set_json_content(self._repo_info_path, content)
def create_empty_catalog(path, name, description): catalog_info_file = CatalogDelegate.get_catalog_info_path(path) catalog_content = {"name": name, "volume": 0, "maxid": 0, "description": description, "datetime": tools.get_time()} tools.set_json_content(catalog_info_file, catalog_content) signs_list_info_file = CatalogDelegate.get_signs_list_info_path(path) signs_list_content = {} tools.set_json_content(signs_list_info_file, signs_list_content) return CatalogDelegate(path)
def create_empty_repo(path, name, description): repo_info_file = RepoDelegate.get_repo_info_path(path) content = { "name": name, "volume": 0, "description": description, "datetime": tools.get_time(), "subdirs": [] } tools.set_json_content(repo_info_file, content) return RepoDelegate(path)
def add_signs(self, signs_path, volume, provider, description): self._maxid += 1 id = self._maxid os.renames(signs_path, os.path.join(self._catalog_path, str(id))) self._volume += volume signs_list_info_file = CatalogDelegate.get_signs_list_info_path(self._catalog_path) signs_list_info = tools.get_json_content(signs_list_info_file) signs_list_info[id] = {'volume': volume, 'provider': provider, 'description': description, 'datetime': tools.get_time()} tools.set_json_content(signs_list_info_file, signs_list_info) self._modified = True
def _exit(self): tools.set_json_content(self._datapool_info_path, {"repos_paths": self._repos_paths})
def _exit(self): if not self._modified: return tools.set_json_content(self._datapool_info_path, {"repos_paths": self._repos_paths})