Allow build with py-prompt_toolkit 2.x

- Bump PORTREVISION for package change

Obtained from:	34de86178d
		d3d84de2aa
Approved by:	dbaio (maintainer)
This commit is contained in:
Sunpoet Po-Chuan Hsieh 2019-04-16 23:50:21 +00:00
parent c87e21c032
commit c1277a2fd3
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=499139
4 changed files with 67 additions and 1 deletions

View file

@ -2,6 +2,7 @@
PORTNAME= http-prompt PORTNAME= http-prompt
PORTVERSION= 1.0.0 PORTVERSION= 1.0.0
PORTREVISION= 1
CATEGORIES= devel python CATEGORIES= devel python
MASTER_SITES= CHEESESHOP MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -14,7 +15,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}click>=5.0:devel/py-click@${PY_FLAVOR} \ 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}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}pygments>=2.1.0:textproc/py-pygments@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}six>=1.10.0:devel/py-six@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}six>=1.10.0:devel/py-six@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}httpie>=0.9.2:www/py-httpie@${PY_FLAVOR} ${PYTHON_PKGNAMEPREFIX}httpie>=0.9.2:www/py-httpie@${PY_FLAVOR}

View file

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

View file

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

View file

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