def update_res(self, old: str, new: str) -> None: if old != new: if res.name_exist(self.res_path, old): if not res.name_exist(self.res_path, new): res.update(self.res_path, old, new) else: raise ResourceError(subcode=ResourceError.res_exist, data=ResourceError.res_exist_mes % new) else: raise ResourceError(subcode=ResourceError.res_not_found, data=ResourceError.res_not_found_mes % old)
def generate_new_res(self, name: str) -> None: if not res.name_exist(self.res_path, name): res.create(self.res_path, name) else: raise ResourceError(subcode=ResourceError.res_exist, data=ResourceError.res_not_found_mes % name)
def delete_res(self, name: str) -> None: if res.name_exist(self.res_path, name): res.delete(merge(self.res_path, name))