From aaa34d863f6529063117b2093151355a2b29e467 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 1 Nov 2018 16:21:53 -0400 Subject: move merge to generator and add module info helper --- qface/utils.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/qface/utils.py b/qface/utils.py index 3122d38..f816b58 100644 --- a/qface/utils.py +++ b/qface/utils.py @@ -1,10 +1,11 @@ +from .generator import FileSystem +from .helper import doc -def merge(a, b): - "merges b into a recursively if a and b are dicts" - for key in b: - if isinstance(a.get(key), dict) and isinstance(b.get(key), dict): - merge(a[key], b[key]) - else: - a[key] = b[key] - return a +def module_info(text): + system = FileSystem.parse_text(text) + module = list(system.modules)[0] + return { + 'title': module.name, + 'brief': " ".join(doc.parse_doc(module.comment).brief) + } -- cgit v1.2.3