From d670513c9fe4f84bfc0eae6cf5e4a585aea61dc8 Mon Sep 17 00:00:00 2001 From: Jakob Kramer Date: Fri, 2 Mar 2012 18:35:33 +0100 Subject: [PATCH] use the __main__ submodule convention to make it possible to use `python -m httpie` --- httpie/{httpie.py => __main__.py} | 0 setup.py | 2 +- tests.py | 7 +++---- 3 files changed, 4 insertions(+), 5 deletions(-) rename httpie/{httpie.py => __main__.py} (100%) diff --git a/httpie/httpie.py b/httpie/__main__.py similarity index 100% rename from httpie/httpie.py rename to httpie/__main__.py diff --git a/setup.py b/setup.py index e6cd692b..2b36c249 100644 --- a/setup.py +++ b/setup.py @@ -15,5 +15,5 @@ setup(name='httpie',version=httpie.__version__, author=httpie.__author__, license=httpie.__licence__, packages=['httpie'], - entry_points={'console_scripts': ['http = httpie.httpie:main']}, + entry_points={'console_scripts': ['http = httpie.__main__:main']}, install_requires=requirements) diff --git a/tests.py b/tests.py index 6e5aec6c..5d2d9b13 100644 --- a/tests.py +++ b/tests.py @@ -1,13 +1,12 @@ import unittest from StringIO import StringIO -from httpie import httpie +from httpie import __main__ def http(*args, **kwargs): stdout = StringIO() - httpie.main(args=args, stdout=stdout, - stdin_isatty=True, - stdout_isatty=False) + __main__.main(args=args, stdout=stdout, stdin_isatty=True, + stdout_isatty=False) return stdout.getvalue()