Fix up dependency checking (use 'dependencies' instead of 'external_dependencies' -> simpler/easier to remember

This commit is contained in:
Patrick Robertson
2025-01-29 19:25:22 +01:00
parent 3d37c494aa
commit 00a7018f36
38 changed files with 81 additions and 49 deletions

View File

@@ -2,8 +2,8 @@
"name": "HTML Formatter",
"type": ["formatter"],
"requires_setup": False,
"external_dependencies": {
"python": ["loguru", "jinja2"],
"dependencies": {
"python": ["hash_enricher", "loguru", "jinja2"],
"bin": [""]
},
"configs": {

View File

@@ -53,6 +53,7 @@ class HtmlFormatter(Formatter):
outf.write(content)
final_media = Media(filename=html_path, _mimetype="text/html")
# get the already instantiated hash_enricher module
he = get_module('hash_enricher', self.config)
if len(hd := he.calculate_hash(final_media.filename)):
final_media.set("hash", f"{he.algorithm}:{hd}")