Add autogenerated help.

This commit is contained in:
Martin Sekera 2019-09-28 03:36:12 +02:00
parent 091db860c2
commit af0881b823
3 changed files with 58 additions and 31 deletions

15
dtk/aux.py Normal file
View file

@ -0,0 +1,15 @@
#! /usr/bin/env python3
# encoding: utf-8
def flatten_dict(root, glue=" ", prefix=[]):
lines = []
for k, v in root.items():
new_prefix = prefix + [k]
if type(v) == dict:
lines.extend(flatten_dict(v, glue, new_prefix))
else:
lines.append((glue.join(new_prefix), v))
return lines