Created
September 8, 2014 15:49
-
-
Save denismakogon/602620e0200f512d39f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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