Permalink
Browse files

use the __main__ submodule convention to make it possible to use `pyt…

…hon -m httpie`
  • Loading branch information...
1 parent 860a851 commit d670513c9fe4f84bfc0eae6cf5e4a585aea61dc8 @gandaro gandaro committed Mar 2, 2012
Showing with 4 additions and 5 deletions.
  1. 0 httpie/{httpie.py → __main__.py}
  2. +1 −1 setup.py
  3. +3 −4 tests.py
File renamed without changes.
View
@@ -15,5 +15,5 @@
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)
View
@@ -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()

0 comments on commit d670513

Please sign in to comment.