blob: d6a6bb5bf00e425065147a6311f4323ca6d6cbfe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
"""template helper functions"""
from pathlib import Path
import re
def get_templates(path: Path):
"""list templates in given path"""
template_pattern = re.compile(r"^[^_]\S+\.mako$")
result = list(path.glob("*.mako"))
result = [item for item in result if template_pattern.match(item.name)]
return result
|