aboutsummaryrefslogtreecommitdiffstats
path: root/qface/utils.py
diff options
context:
space:
mode:
authorJuergen Bocklage-Ryannel <juergen@ryannel.org>2018-12-24 13:28:16 +0100
committerJuergen Bocklage-Ryannel <juergen@ryannel.org>2018-12-24 13:28:16 +0100
commitf354532d7cc9e3663b005f5413baf03833c60398 (patch)
treee2bcb28bb3d8f3d3efc86bb1c064380cd5579e60 /qface/utils.py
parent22840dd0a67644afd20c1b9c4dfffa2c23cb4c6d (diff)
- introduce qface script mode
- add ability to load dynamic filters for qface script mode - extract generic filters - fixed some issues with cpp macros
Diffstat (limited to 'qface/utils.py')
-rw-r--r--qface/utils.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/qface/utils.py b/qface/utils.py
index f816b58..889d862 100644
--- a/qface/utils.py
+++ b/qface/utils.py
@@ -9,3 +9,16 @@ def module_info(text):
'title': module.name,
'brief': " ".join(doc.parse_doc(module.comment).brief)
}
+
+
+def load_filters(path):
+ if not path.exists():
+ print('filter module does not exist')
+ return {}
+
+ ctx = {
+ 'filters': {}
+ }
+ exec(path.text(), ctx)
+ return ctx['filters']
+