# HG changeset patch # User Jeff Hammel # Date 1382266494 25200 # Node ID f6474c7dfb397c2ecd178983fa97671053cdade4 # Parent 0c95d7f25d9bacc451a6aa421650e660a0726930 makeitso/mkpydir.py diff -r 0c95d7f25d9b -r f6474c7dfb39 makeitso/mkpydir.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/makeitso/mkpydir.py Sun Oct 20 03:54:54 2013 -0700 @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +""" +make a python module directory with an __init__.py +""" + +import optparse +import os +import sys + +def main(args=sys.argv[1:]): + + usage = '%prog [options] directory_name' + parser = optparse.OptionParser(usage=usage, description=__doc__) + options, args = parser.parse_args(args) + if len(args) != 1: + parser.print_usage() + parser.error() + + os.makedirs(args[0]) + init = os.path.join(args[0], '__init__.py') + with f as open(init, 'w'): + f.write('#\n') + +if __name__ == '__main__': + main()