diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-10-27 17:14:15 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-10-27 17:14:15 +0200 |
commit | 728fcad5e498ac26b108383d7117ad59ad029fd3 (patch) | |
tree | 7b1e1f408c42b96cc62db287ce070e8a2cef2609 /src/hydrilla | |
parent | 32a2de0c3ff6dec5bc3ef6496b7e3cdde671e5f3 (diff) | |
download | haketilo-hydrilla-728fcad5e498ac26b108383d7117ad59ad029fd3.tar.gz haketilo-hydrilla-728fcad5e498ac26b108383d7117ad59ad029fd3.zip |
[proxy] gather available doc page identifiers programmatically
Diffstat (limited to 'src/hydrilla')
-rw-r--r-- | src/hydrilla/proxy/self_doc.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/hydrilla/proxy/self_doc.py b/src/hydrilla/proxy/self_doc.py index ccf0e12..838df57 100644 --- a/src/hydrilla/proxy/self_doc.py +++ b/src/hydrilla/proxy/self_doc.py @@ -6,6 +6,16 @@ import jinja2 +from pathlib import Path + + +here = Path(__file__).resolve().parent + loader = jinja2.PackageLoader(__package__, package_path='self_doc') -page_names = {'url_patterns', 'policy_selection'} +suffix_len = len('.html.jinja') +page_names = frozenset( + path.name[:-suffix_len] + for path in (here / 'self_doc').glob('*.html.jinja') + if path.name != 'doc_base.html.jinja' +) |