Skip to content

Instantly share code, notes, and snippets.

@cyberbikepunk
Created May 16, 2016 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyberbikepunk/a219de69bfad2c174e840cd24fd74f58 to your computer and use it in GitHub Desktop.
Save cyberbikepunk/a219de69bfad2c174e840cd24fd74f58 to your computer and use it in GitHub Desktop.
Print all CAPITALIZED settings in a settings file.
def show_settings():
""" Echo all settings. """
print('Current m5 settings:', end='\n\n')
objects = dir(modules[__name__])
parameters = [x for x in objects if x.isupper() and x is not 'PASSWORD']
for p in parameters:
value = getattr(modules[__name__], p)
print('{item} = {value!r}'.format(item=p.rjust(20, ' '), value=value))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment