diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/reqs2tex.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/reqs2tex.py b/scripts/reqs2tex.py index db7e174..8c2236a 100755 --- a/scripts/reqs2tex.py +++ b/scripts/reqs2tex.py @@ -25,18 +25,19 @@ class REQ_PRIORITY(StrEnum): COULD = 'could' WONT = 'will not' -# this doesn't work right def flatten(data): out = [] - # this key is a requirement - if KEY.DESCRIPTION in data: - out.append(data) - # check for children for key, value in data.items(): + # this item is a requirement + if key == KEY.DESCRIPTION: + out.append(data) + # skip over reserved keys if key in KEY: continue + # recursively flatten other requirements items = flatten(value) + # and prefix them with the current key for item in items: if KEY.LABEL in item: item[KEY.LABEL] = f"{key}.{item[KEY.LABEL]}" |