diff options
-rw-r--r-- | numpy/distutils/conv_template.py | 6 | ||||
-rw-r--r-- | numpy/distutils/from_template.py | 6 | ||||
-rwxr-xr-x | setup.py | 7 |
3 files changed, 15 insertions, 4 deletions
diff --git a/numpy/distutils/conv_template.py b/numpy/distutils/conv_template.py index a42611051..4a8746236 100644 --- a/numpy/distutils/conv_template.py +++ b/numpy/distutils/conv_template.py @@ -315,8 +315,7 @@ def unique_key(adict): return newkey -if __name__ == "__main__": - +def main(): try: file = sys.argv[1] except IndexError: @@ -335,3 +334,6 @@ if __name__ == "__main__": e = get_exception() raise ValueError("In %s loop at %s" % (file, e)) outfile.write(writestr) + +if __name__ == "__main__": + main() diff --git a/numpy/distutils/from_template.py b/numpy/distutils/from_template.py index b19c7cc0b..8f587eab9 100644 --- a/numpy/distutils/from_template.py +++ b/numpy/distutils/from_template.py @@ -238,8 +238,7 @@ _special_names = find_repl_patterns(''' <ctypereal=float,double,\\0,\\1> ''') -if __name__ == "__main__": - +def main(): try: file = sys.argv[1] except IndexError: @@ -254,3 +253,6 @@ if __name__ == "__main__": allstr = fid.read() writestr = process_str(allstr) outfile.write(writestr) + +if __name__ == "__main__": + main() @@ -360,6 +360,13 @@ def setup_package(): cmdclass={"sdist": sdist_checked}, python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*', zip_safe=False, + entry_points={ + 'console_scripts': [ + 'f2py = numpy.f2py.__main__:main', + 'conv-template = numpy.distutils.conv_template:main', + 'from-template = numpy.distutils.conv_template:main', + ] + }, ) if "--force" in sys.argv: |