Merge branch 'main-module-convention' of https://github.com/gandaro/httpie into gandaro-main-module-convention

Renamed httpie.httpie to httpie.__main__ so that one can invoke it via python -m httpie.
This commit is contained in:
Jakub Roztočil 2012-03-04 03:13:50 +01:00
commit ca8779d879
3 changed files with 3 additions and 4 deletions

View File

@ -15,5 +15,5 @@ setup(name='httpie',version=httpie.__version__,
author=httpie.__author__, author=httpie.__author__,
license=httpie.__licence__, license=httpie.__licence__,
packages=['httpie'], packages=['httpie'],
entry_points={'console_scripts': ['http = httpie.httpie:main']}, entry_points={'console_scripts': ['http = httpie.__main__:main']},
install_requires=requirements) install_requires=requirements)

View File

@ -1,7 +1,6 @@
from functools import partial
import unittest import unittest
from StringIO import StringIO from StringIO import StringIO
from httpie import httpie from httpie import __main__
TERMINAL_COLOR_END = '\x1b[39m' TERMINAL_COLOR_END = '\x1b[39m'
@ -14,7 +13,7 @@ def http(*args, **kwargs):
} }
http_kwargs.update(kwargs) http_kwargs.update(kwargs)
stdout = http_kwargs.setdefault('stdout', StringIO()) stdout = http_kwargs.setdefault('stdout', StringIO())
httpie.main(args=args, **http_kwargs) __main__.main(args=args, **http_kwargs)
return stdout.getvalue() return stdout.getvalue()