summaryrefslogtreecommitdiff
path: root/grc/core/utils/extract_docs.py
diff options
context:
space:
mode:
authorSebastian Koslowski <sebastian.koslowski@gmail.com>2016-05-03 17:13:08 +0200
committerJohnathan Corgan <johnathan@corganlabs.com>2017-06-29 09:16:49 -0700
commit7f7fa2f91467fdb2b11312be8562e7b51fdeb199 (patch)
tree24268bac15b9920d2a15ddbb45eaf3b9b03718a1 /grc/core/utils/extract_docs.py
parent44cae388881821942e691a4d69a923bbd8d347db (diff)
grc: added yaml/mako support
Includes basic converter from XML/Cheetah to YAML/Mako based block format.
Diffstat (limited to 'grc/core/utils/extract_docs.py')
-rw-r--r--grc/core/utils/extract_docs.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/grc/core/utils/extract_docs.py b/grc/core/utils/extract_docs.py
index cff8a81099..7688f98de5 100644
--- a/grc/core/utils/extract_docs.py
+++ b/grc/core/utils/extract_docs.py
@@ -98,8 +98,7 @@ def docstring_from_make(key, imports, make):
if '$' in blk_cls:
raise ValueError('Not an identifier')
ns = dict()
- for _import in imports:
- exec(_import.strip(), ns)
+ exec(imports.strip(), ns)
blk = eval(blk_cls, ns)
doc_strings = {key: blk.__doc__}
@@ -166,7 +165,8 @@ class SubprocessLoader(object):
else:
break # normal termination, return
finally:
- self._worker.terminate()
+ if self._worker:
+ self._worker.terminate()
else:
print("Warning: docstring loader crashed too often", file=sys.stderr)
self._thread = None
@@ -277,7 +277,7 @@ elif __name__ == '__main__':
print(key)
for match, doc in six.iteritems(docs):
print('-->', match)
- print(doc.strip())
+ print(str(doc).strip())
print()
print()