# HG changeset patch # User Mattijs Hoitink # Date 1329487222 -3600 # Node ID fc54225e8b510c18e515f9d0dfbc9eda450853a9 # Parent afba81586593006b9b47194a4017fbbafb9de1e0 Swapped argparse module for optparse module To lower the minimum python requirements the argparse module (2.7+) is swapped for the optparse module. diff -r afba81586593 -r fc54225e8b51 bin/d --- a/bin/d Tue Feb 14 19:17:30 2012 +0100 +++ b/bin/d Fri Feb 17 15:00:22 2012 +0100 @@ -1,6 +1,6 @@ #!/usr/bin/env python -import sys, os, argparse +import sys, os, optparse # Ugly hack so I can code in peace. try: @@ -11,12 +11,12 @@ if __name__ == '__main__': - # Argument parser - parser = argparse.ArgumentParser(description='Markdown files to documentation. Run and get on with your life.') - parser.add_argument('-s', dest='source', default='.', help='Documentation source', metavar='SOURCE') - parser.add_argument('-t', dest='target', default='./build', help='Documentation output target', metavar='TARGET') + # Option parser + parser = optparse.OptionParser(description='Markdown files to documentation. Run and get on with your life.') + parser.add_option('-s', dest='source', default='.', help='Documentation source', metavar='SOURCE') + parser.add_option('-t', dest='target', default='./build', help='Documentation output target', metavar='TARGET') - args = parser.parse_args() + (options, args) = parser.parse_args() # Render with arguments - render_files(args.source, args.target) + render_files(options.source, options.target)