diff --git a/devel/py-http-prompt/Makefile b/devel/py-http-prompt/Makefile index 0216b0b75bd8..aa344bfe94e5 100644 --- a/devel/py-http-prompt/Makefile +++ b/devel/py-http-prompt/Makefile @@ -2,6 +2,7 @@ PORTNAME= http-prompt PORTVERSION= 1.0.0 +PORTREVISION= 1 CATEGORIES= devel python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -14,7 +15,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}click>=5.0:devel/py-click@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}parsimonious>=0.6.2:textproc/py-parsimonious@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}prompt_toolkit>=1.0.0:devel/py-prompt_toolkit@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}prompt_toolkit>=2.0.0:devel/py-prompt_toolkit@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pygments>=2.1.0:textproc/py-pygments@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}six>=1.10.0:devel/py-six@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}httpie>=0.9.2:www/py-httpie@${PY_FLAVOR} diff --git a/devel/py-http-prompt/files/patch-http_prompt-cli.py b/devel/py-http-prompt/files/patch-http_prompt-cli.py new file mode 100644 index 000000000000..bba3bce0d64c --- /dev/null +++ b/devel/py-http-prompt/files/patch-http_prompt-cli.py @@ -0,0 +1,40 @@ +Obtained from: https://github.com/jonathanslenders/http-prompt/commit/34de86178d8ae2b478e0ad989222aab24dd4c046 + https://github.com/jonathanslenders/http-prompt/commit/d3d84de2aa7f3fce521e5ac63f4bbcf9a2166501 + +--- http_prompt/cli.py.orig 2018-11-04 14:03:53 UTC ++++ http_prompt/cli.py +@@ -9,11 +9,11 @@ import click + + 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 +@@ -135,7 +135,7 @@ def cli(spec, env, url, http_options): + style_class = get_style_by_name(cfg['command_style']) + except ClassNotFound: + style_class = Solarized256Style +- style = style_from_pygments(style_class) ++ style = style_from_pygments_cls(style_class) + + listener = ExecutionListener(cfg) + +@@ -159,7 +159,9 @@ def cli(spec, env, url, http_options): + text = prompt('%s> ' % context.url, completer=completer, + lexer=lexer, style=style, history=history, + auto_suggest=AutoSuggestFromHistory(), +- on_abort=AbortAction.RETRY, vi_mode=cfg['vi']) ++ vi_mode=cfg['vi']) ++ except KeyboardInterrupt: ++ continue # Control-C pressed + except EOFError: + break # Control-D pressed + else: diff --git a/devel/py-http-prompt/files/patch-http_prompt-utils.py b/devel/py-http-prompt/files/patch-http_prompt-utils.py new file mode 100644 index 000000000000..cf338f5e307a --- /dev/null +++ b/devel/py-http-prompt/files/patch-http_prompt-utils.py @@ -0,0 +1,13 @@ +Obtained from: https://github.com/jonathanslenders/http-prompt/commit/34de86178d8ae2b478e0ad989222aab24dd4c046 + +--- http_prompt/utils.py.orig 2018-11-04 14:03:53 UTC ++++ http_prompt/utils.py +@@ -3,7 +3,7 @@ from __future__ import unicode_literals + import math + import re + +-from prompt_toolkit.shortcuts import create_output ++from prompt_toolkit.output.defaults import create_output + from six.moves import range + + diff --git a/devel/py-http-prompt/files/patch-requirements.txt b/devel/py-http-prompt/files/patch-requirements.txt new file mode 100644 index 000000000000..0fbd1f3e4920 --- /dev/null +++ b/devel/py-http-prompt/files/patch-requirements.txt @@ -0,0 +1,12 @@ +Obtained from: https://github.com/jonathanslenders/http-prompt/commit/34de86178d8ae2b478e0ad989222aab24dd4c046 + +--- requirements.txt.orig 2018-11-04 14:03:53 UTC ++++ requirements.txt +@@ -1,6 +1,6 @@ + click>=5.0 + httpie>=0.9.2 + parsimonious>=0.6.2 +-prompt-toolkit>=1.0.0,<2.0.0 ++prompt-toolkit>=2.0.0,<2.1.0 + Pygments>=2.1.0 + six>=1.10.0