summaryrefslogtreecommitdiff
path: root/techlibs/common/cellhelp.py
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-10-17 02:22:42 +0200
committerClifford Wolf <clifford@clifford.at>2015-10-17 02:35:19 +0200
commit5d1c0ce7c0be94b5809ea45a62aeb9dd76a3e060 (patch)
treea86330507c36cc54cd5d001a567f1d5fea197cdf /techlibs/common/cellhelp.py
parent255bb914bada727806df4bdc22ab8472f03a6317 (diff)
Progress on cell help messages
Diffstat (limited to 'techlibs/common/cellhelp.py')
-rw-r--r--techlibs/common/cellhelp.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/techlibs/common/cellhelp.py b/techlibs/common/cellhelp.py
index 7844ccb4..5c44cb80 100644
--- a/techlibs/common/cellhelp.py
+++ b/techlibs/common/cellhelp.py
@@ -6,6 +6,7 @@ import json
current_help_msg = []
current_module_code = []
current_module_name = None
+current_module_signature = None
def print_current_cell():
print("cell_help[\"%s\"] = %s;" % (current_module_name, "\n".join([json.dumps(line) for line in current_help_msg])))
@@ -16,10 +17,18 @@ for line in fileinput.input():
current_help_msg.append(line[4:] if len(line) > 4 else "\n")
if line.startswith("module "):
current_module_name = line.split()[1].strip("\\")
+ current_module_signature = " ".join(line.replace("\\", "").replace(";", "").split()[1:])
current_module_code = []
- current_module_code.append(line)
+ elif not line.startswith("endmodule"):
+ line = " " + line
+ current_module_code.append(line.replace("\t", " "))
if line.startswith("endmodule"):
- if len(current_help_msg) > 0:
- print_current_cell()
+ if len(current_help_msg) == 0:
+ current_help_msg.append("\n")
+ current_help_msg.append(" %s\n" % current_module_signature)
+ current_help_msg.append("\n")
+ current_help_msg.append("No help message for this cell type found.\n")
+ current_help_msg.append("\n")
+ print_current_cell()
current_help_msg = []