X-Git-Url: https://git.mar77i.info/?a=blobdiff_plain;f=hub%2Futils.py;h=d888f1588a19b74a65559a6869b54c3162762b7c;hb=f591748910835b1a11c3765723d9d30193a5bd26;hp=3e91e239b6ad753beea77fcd90e22ab3e313cab1;hpb=a12839ce8fe46f0c2c0e98a37deebba05ea404b5;p=hublib diff --git a/hub/utils.py b/hub/utils.py index 3e91e23..d888f15 100644 --- a/hub/utils.py +++ b/hub/utils.py @@ -1,12 +1,14 @@ from jinja2_simple_tags import StandaloneTag -from .static import TreeFileApp +from .static import StaticTemplateFile, TreeFileApp class StaticTag(StandaloneTag): tags = {"static"} @staticmethod - def get_hubapp(static_file, hubapp): + def get_hubapp( + static_file: StaticTemplateFile, hubapp: str | TreeFileApp | None + ) -> TreeFileApp: h = static_file.hubapp if hubapp == "root": return h.root @@ -42,4 +44,4 @@ def get_redis_pass(redis_conf: str) -> str: for line in fh: if line.startswith(prefix): return line[len(prefix) :].rstrip() - return None + raise ValueError("No redis password found")