1
0
mirror of https://github.com/httpie/cli.git synced 2024-11-24 08:22:22 +02:00

use the __main__ submodule convention to make it possible to use python -m httpie

This commit is contained in:
Jakob Kramer 2012-03-02 18:35:33 +01:00
parent 860a851a4b
commit d670513c9f
3 changed files with 4 additions and 5 deletions

View File

@ -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)

View File

@ -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()