Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import sys, os
- def make_namespaced(path):
- init_file = os.path.join(path, "__init__.py")
- if os.path.exists(init_file):
- return
- open(init_file, "w").write("import pkg_resources\npkg_resources.declare_namespace(__name__)\n\n")
- [make_namespaced(i[0]) for i in os.walk(sys.argv[1])]
Add Comment
Please, Sign In to add comment