mirror of
https://git.ari.lt/ari.lt/blog.ari.lt.git
synced 2025-02-04 09:39:25 +01:00
update @ Tue 12 Apr 23:43:22 EEST 2022
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
parent
9cc3735aec
commit
d54ee81c2e
1 changed files with 0 additions and 27 deletions
27
scripts/blog
27
scripts/blog
|
@ -131,27 +131,6 @@ def log(message: str, header: str = "ERROR", code: int = EXIT_ERR) -> int:
|
|||
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:
|
||||
_title: str = ""
|
||||
|
||||
|
@ -565,12 +544,6 @@ def generate_metadata(config: Dict) -> Tuple[int, Dict]:
|
|||
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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue