# HG changeset patch # User Jeff Hammel # Date 1491009396 25200 # Node ID b4a3e8bbe09502404bf0ef48ad7889997df5f5e8 # Parent 3840a2c5bc4f5d7dedbff01fb613e17bf27bb34c py 3 + version bump diff -r 3840a2c5bc4f -r b4a3e8bbe095 makeitso/python_package/{{package}}/{{main}}.py --- a/makeitso/python_package/{{package}}/{{main}}.py Fri Mar 31 18:12:09 2017 -0700 +++ b/makeitso/python_package/{{package}}/{{main}}.py Fri Mar 31 18:16:36 2017 -0700 @@ -27,7 +27,14 @@ # module globals __all__ = ['main', 'Parser'] here = os.path.dirname(os.path.realpath(__file__)) -string = (str, unicode) + +try: + # python 2 + string = (str, unicode) +except NameError: + # python 3 + string = (str, ) + def ensure_dir(directory): """ensure a directory exists""" @@ -41,6 +48,7 @@ class Parser(argparse.ArgumentParser): """CLI option parser""" + def __init__(self, **kwargs): kwargs.setdefault('formatter_class', argparse.RawTextHelpFormatter) kwargs.setdefault('description', __doc__) @@ -59,6 +67,7 @@ def validate(self, options): """validate options""" + def main(args=sys.argv[1:]): """CLI""" @@ -75,6 +84,7 @@ except KeyboardInterrupt: pass + if __name__ == '__main__': main() diff -r 3840a2c5bc4f -r b4a3e8bbe095 setup.py --- a/setup.py Fri Mar 31 18:12:09 2017 -0700 +++ b/setup.py Fri Mar 31 18:16:36 2017 -0700 @@ -16,7 +16,7 @@ except IOError: description = '' -version = '0.4.4' +version = '0.4.5' setup(name='MakeItSo', version=version,