--- http_prompt/cli.py.orig 2019-03-11 10:35:47.000000000 -0400
+++ http_prompt/cli.py 2019-03-11 10:36:10.000000000 -0400
from httpie.plugins import FormatterPlugin # noqa, avoid cyclic import
from httpie.output.formatters.colors import Solarized256Style
-from prompt_toolkit import prompt, AbortAction
+from prompt_toolkit import prompt
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit.history import FileHistory
-from prompt_toolkit.layout.lexers import PygmentsLexer
-from prompt_toolkit.styles.from_pygments import style_from_pygments
+from prompt_toolkit.lexers import PygmentsLexer
+from prompt_toolkit.styles.pygments import style_from_pygments_cls
from pygments.styles import get_style_by_name
from pygments.util import ClassNotFound
from six.moves.http_cookies import SimpleCookie
cookie = SimpleCookie(base_value)
for k, v in cookies.items():
- return str(cookie.output(header='', sep=';').lstrip())
+ return cookie.output(header='', sep=';').lstrip()
class ExecutionListener(object):
@click.option('--env', help="Environment file to preload.",
type=click.Path(exists=True))
-@click.argument('url', default='')
+@click.argument('url', default='http://localhost:8000')
@click.argument('http_options', nargs=-1, type=click.UNPROCESSED)
@click.version_option(message='%(version)s')
def cli(spec, env, url, http_options):
- url = fix_incomplete_url(url)
+ url = fix_incomplete_url(url)
context = Context(url, spec=spec)
output_style = cfg.get('output_style')
style_class = get_style_by_name(cfg['command_style'])
style_class = Solarized256Style
- style = style_from_pygments(style_class)
+ style = style_from_pygments_cls(style_class)
listener = ExecutionListener(cfg)
load_context(context, env)
- # Overwrite the env url if not default
+ if url != 'http://localhost:8000':
+ # overwrite the env url if not default