Skip to content

Instantly share code, notes, and snippets.

@denismakogon
Created September 8, 2014 15:49
Show Gist options
  • Save denismakogon/602620e0200f512d39f9 to your computer and use it in GitHub Desktop.
Save denismakogon/602620e0200f512d39f9 to your computer and use it in GitHub Desktop.
from trove.common import cfg
if __name__ == "__main__":
attr_list = [x for x in dir(cfg) if '_opts' in x]
for attr in attr_list:
group = "DEFAULT" if attr[:-5].upper() == 'COMMON' else attr[:-5].upper()
print("[%s]" % group)
for opt in getattr(cfg, attr):
if hasattr(opt, 'help'):
if opt.help:
print('#' + opt.help)
print(opt.name + ' = ' + (str(opt.default) if opt.default is not None else ''))
print('\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment