From a59efcf1ecf2290c40a44a14b2c3b204bcb7178e Mon Sep 17 00:00:00 2001 From: Ferrari Martino Giordano Date: Wed, 13 Mar 2024 15:04:40 +0100 Subject: [PATCH] refactoring: renamed few functions --- autodoc/autodoc.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/autodoc/autodoc.py b/autodoc/autodoc.py index 42cc26d..ca0699b 100644 --- a/autodoc/autodoc.py +++ b/autodoc/autodoc.py @@ -8,6 +8,16 @@ import common as doc from doc_state import * +def __doc_app_state__(state, tab=" │ "): + res = "" + if "+Threads" in state: + for i, tname in enumerate(state["+Threads"]): + if tname[0] == "+": + ch = "├─●" if i < len(state["+Threads"]) - 1 else "╰─●" + res += f"{tab} {ch} {tname[1:]}\n" + return res + + def __doc_application__(label, app): mdapp = f'\n## Real-time application "{label[1:]}"\n\n' mdapp += f"Below are descrbed the states and threads of the real-time application {label[1:]}.\n" @@ -21,7 +31,7 @@ def __doc_application__(label, app): tab = " │ " if i < len(states) - 1 else " " if label[0] == "+": mdapp += f" {ch} {label[1:]}\n" - mdapp += doc_app_state(obj, tab) + mdapp += __doc_app_state__(obj, tab) mdapp += "```\n" for label, obj in states.items(): if label[0] == "+":