aboutsummaryrefslogtreecommitdiff
path: root/tools/interface_generator/bin/templates.py
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2024-08-18 15:08:13 +0300
committeraqua <aqua@iserlohn-fortress.net>2024-08-18 15:08:13 +0300
commitff0286195eeb4dc659863af4afbdf9ddd4d53a1b (patch)
tree94b06a2efdf8b349f7822dd79f5a6de5780bcbe3 /tools/interface_generator/bin/templates.py
parentMoved pytest to private (diff)
downloadkernel-ff0286195eeb4dc659863af4afbdf9ddd4d53a1b.tar.xz
Moved interface_generator script to bin
Diffstat (limited to 'tools/interface_generator/bin/templates.py')
-rw-r--r--tools/interface_generator/bin/templates.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/interface_generator/bin/templates.py b/tools/interface_generator/bin/templates.py
new file mode 100644
index 0000000..d6a6bb5
--- /dev/null
+++ b/tools/interface_generator/bin/templates.py
@@ -0,0 +1,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