Skip to content

Instantly share code, notes, and snippets.

@mirakui
Created June 6, 2009 16:38
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 mirakui/124905 to your computer and use it in GitHub Desktop.
Save mirakui/124905 to your computer and use it in GitHub Desktop.
import sys
import re
import yaml
if len(sys.argv) != 2:
print 'Usage: python %s <mod_name>' % sys.argv[0]
quit()
mod_name = sys.argv[1]
mod = __import__(mod_name)
result_dict = {}
re_not_private = re.compile('(?!^__.*__$)')
for items_name in dir(mod):
if re_not_private.match(items_name):
result_dict[items_name] = eval('mod.'+items_name)
print yaml.dump(result_dict)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment