update @ Tue 12 Apr 23:43:22 EEST 2022

Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
Ari Archer 2022-04-12 23:43:22 +03:00
parent 9cc3735aec
commit d54ee81c2e
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: A50D5B4B599AF8A2

View file

@ -131,27 +131,6 @@ def log(message: str, header: str = "ERROR", code: int = EXIT_ERR) -> int:
return code return code
def generate_file_hash(filename: str):
hash_filename = filename + ".hash"
log(filename, "READ")
with open(filename, "rb") as file:
file_content = file.read()
log(hash_filename, "GENERATE")
with open(hash_filename, "w") as hash_file:
for hashf in hashlib.algorithms_available:
try:
print(
f"{hashf} {getattr(hashlib, hashf)(file_content).hexdigest()}",
file=hash_file,
)
except (TypeError, AttributeError):
pass
def sanitise_title(title: str, titleset: Dict) -> str: def sanitise_title(title: str, titleset: Dict) -> str:
_title: str = "" _title: str = ""
@ -565,12 +544,6 @@ def generate_metadata(config: Dict) -> Tuple[int, Dict]:
manifest, manifest,
) )
log(f"Hashing {manifest.name}", "HASH")
generate_file_hash(manifest.name)
log(f"Hashing {DEFAULT_CONFIG_FILE}", "HASH")
generate_file_hash(DEFAULT_CONFIG_FILE)
return EXIT_OK, config return EXIT_OK, config