Продолжаю работу над БД. Начальная реализация удаления пакетов.

This commit is contained in:
Евгений Титаренко 2023-07-23 23:31:28 +03:00
parent c292a7f516
commit b9fe58a482
3 changed files with 68 additions and 4 deletions

View file

@ -129,3 +129,11 @@ def check_file_hash(path, ref_hash):
data = f.read(buffer_size)
hash.update(data)
return hash.hexdigest() == ref_hash
def remove(mc_dir_rel_path):
path = os.path.join(mc_dir, mc_dir_rel_path)
if is_path_exist(path):
os.remove(path)
else:
raise FileNotFoundError