From 9792a29d8a40f6a8ddc91f9dac11cbf2f77bfb9a Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Fri, 1 Dec 2017 07:55:35 +0100 Subject: [PATCH] add: numerical value is now displayed in the documentation --- tools/machinetag.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/machinetag.py b/tools/machinetag.py index 8734fa4..da1cae4 100755 --- a/tools/machinetag.py +++ b/tools/machinetag.py @@ -97,7 +97,9 @@ def asciidoc(content=False, adoc=doc, t='title'): content = "\n{} \n".format(value) except: content = "\n{} \n".format(content) - + elif t == 'numerical_value': + (n, value) = content.split(":", 1) + content = "\nAssociated numerical value=\"{}\" \n".format(value) adoc = adoc + content return adoc @@ -137,6 +139,8 @@ for taxonomy in taxonomies: doc = asciidoc(content=machineTag(namespace=namespace, predicate=predicate['expanded']), adoc=doc, t='description') if predicate.get('description'): doc = asciidoc(content=machineTag(namespace=namespace, predicate=predicate['description']), adoc=doc, t='description') + if predicate.get('numerical_value'): + doc = asciidoc(content=machineTag(namespace=namespace, predicate=predicate['numerical_value']), adoc=adoc, t='description') else: print(machineTag(namespace=namespace, predicate=predicate['value'])) if args.e: @@ -154,6 +158,8 @@ for taxonomy in taxonomies: doc = asciidoc(content=machineTag(namespace=namespace, predicate=v['expanded']), adoc=doc, t='description') if 'description' in v: doc = asciidoc(content=machineTag(namespace=namespace, predicate=v['description']), adoc=doc, t='description') + if v.get('numerical_value'): + doc = asciidoc(content=machineTag(namespace=namespace, predicate=v['numerical_value']), adoc=doc, t='numerical_value') else: print(machineTag(namespace=namespace, predicate=e['predicate'], value=v['value'])) if args.e: