Skip to content

Instantly share code, notes, and snippets.

@mirakui mirakui/mod2yml.py
Created Jun 6, 2009

Embed
What would you like to do?
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
You can’t perform that action at this time.