Change debug output for downloading files

This commit is contained in:
Stephan Kulow
2022-11-06 09:59:09 +01:00
parent 834cf61634
commit 9114c2fff8
2 changed files with 3 additions and 6 deletions

View File

@@ -1,6 +1,5 @@
from __future__ import annotations
import logging
from hashlib import md5
from pathlib import Path
from typing import Optional
@@ -235,7 +234,6 @@ class DBRevision:
If it's None, the repository is empty.
"""
to_download = []
to_delete = []
if current_rev:
old_files = {
e["name"]: f"{e['md5']}-{e['size']}" for e in current_rev.files_list()
@@ -244,12 +242,9 @@ class DBRevision:
old_files = dict()
for entry in self.files_list():
if old_files.get(entry["name"]) != f"{entry['md5']}-{entry['size']}":
logging.debug(f"Download {entry['name']}")
to_download.append((Path(entry["name"]), entry["size"], entry["md5"]))
old_files.pop(entry["name"], None)
for entry in old_files.keys():
logging.debug(f"Delete {entry}")
to_delete.append(Path(entry))
to_delete = [Path(e) for e in old_files.keys()]
return to_download, to_delete
@staticmethod