Hello community,
here is the log from the commit of package python-prompt_toolkit for
openSUSE:Factory checked in at 2018-11-06 14:29:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-prompt_toolkit (Old)
and /work/SRC/openSUSE:Factory/.python-prompt_toolkit.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-prompt_toolkit"
Tue Nov 6 14:29:14 2018 rev:9 rq:646016 version:2.0.7
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-prompt_toolkit/python-prompt_toolkit.changes
2018-10-15 09:44:55.791271568 +0200
+++
/work/SRC/openSUSE:Factory/.python-prompt_toolkit.new/python-prompt_toolkit.changes
2018-11-06 14:29:53.173414597 +0100
@@ -1,0 +2,25 @@
+Thu Nov 1 22:41:46 UTC 2018 - Arun Persaud <[email protected]>
+
+- update to version 2.0.7:
+ * Bug fixes:
+ + Fixed assertion in PromptSession: the style_transformation check
+ was wrong.
+ + Removed 'default' attribute in PromptSession. Only ask for it in
+ the `prompt()` method. This fixes the issue that passing
+ `default` once, will store it for all consequent calls in the
+ `PromptSession`.
+ + Ensure that `__pt_formatted_text__` always returns a
+ `FormattedText` instance. This fixes an issue with
+ `print_formatted_text`.
+ * New features:
+ + Improved handling of situations where stdin or stdout are not a
+ terminal. (Print warning instead of failing with an assertion.)
+ + Added `print_container` utility.
+ + Sound bell when attempting to edit read-only buffer.
+ + Handle page-down and page-up keys in RadioList.
+ + Accept any `collections.abc.Sequence` for HSplit/VSplit children
+ (instead of lists only).
+ + Improved Vi key bindings: return to navigation mode when Insert
+ is pressed.
+
+-------------------------------------------------------------------
Old:
----
prompt_toolkit-2.0.6.tar.gz
New:
----
prompt_toolkit-2.0.7.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-prompt_toolkit.spec ++++++
--- /var/tmp/diff_new_pack.GQx5QN/_old 2018-11-06 14:29:53.929413571 +0100
+++ /var/tmp/diff_new_pack.GQx5QN/_new 2018-11-06 14:29:53.929413571 +0100
@@ -20,7 +20,7 @@
%define oldpython python
%bcond_without test
Name: python-prompt_toolkit
-Version: 2.0.6
+Version: 2.0.7
Release: 0
Summary: Library for building interactive command lines in Python
License: BSD-3-Clause
++++++ prompt_toolkit-2.0.6.tar.gz -> prompt_toolkit-2.0.7.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/prompt_toolkit-2.0.6/CHANGELOG
new/prompt_toolkit-2.0.7/CHANGELOG
--- old/prompt_toolkit-2.0.6/CHANGELOG 2018-10-12 18:47:17.000000000 +0200
+++ new/prompt_toolkit-2.0.7/CHANGELOG 2018-10-30 22:17:55.000000000 +0100
@@ -1,6 +1,28 @@
CHANGELOG
=========
+2.0.7: 2018-10-30
+-----------------
+
+Bug fixes:
+- Fixed assertion in PromptSession: the style_transformation check was wrong.
+- Removed 'default' attribute in PromptSession. Only ask for it in the
+ `prompt()` method. This fixes the issue that passing `default` once, will
+ store it for all consequent calls in the `PromptSession`.
+- Ensure that `__pt_formatted_text__` always returns a `FormattedText`
+ instance. This fixes an issue with `print_formatted_text`.
+
+New features:
+- Improved handling of situations where stdin or stdout are not a terminal.
+ (Print warning instead of failing with an assertion.)
+- Added `print_container` utility.
+- Sound bell when attempting to edit read-only buffer.
+- Handle page-down and page-up keys in RadioList.
+- Accept any `collections.abc.Sequence` for HSplit/VSplit children (instead of
+ lists only).
+- Improved Vi key bindings: return to navigation mode when Insert is pressed.
+
+
2.0.6: 2018-10-12
-----------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/prompt_toolkit-2.0.6/PKG-INFO
new/prompt_toolkit-2.0.7/PKG-INFO
--- old/prompt_toolkit-2.0.6/PKG-INFO 2018-10-12 18:48:47.000000000 +0200
+++ new/prompt_toolkit-2.0.7/PKG-INFO 2018-10-30 22:23:42.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: prompt_toolkit
-Version: 2.0.6
+Version: 2.0.7
Summary: Library for building powerful interactive command lines in Python
Home-page: https://github.com/jonathanslenders/python-prompt-toolkit
Author: Jonathan Slenders
@@ -12,8 +12,10 @@
|Build Status| |AppVeyor| |PyPI| |RTD| |License|
- ``prompt_toolkit`` is a library for building powerful interactive
command lines
- and terminal applications in Python.
+ .. image ::
https://github.com/prompt-toolkit/python-prompt-toolkit/raw/master/docs/images/logo_400px.png
+
+ *``prompt_toolkit`` is a library for building powerful interactive
command line
+ applications in Python.*
Read the `documentation on readthedocs
<http://python-prompt-toolkit.readthedocs.io/en/stable/>`_.
@@ -30,10 +32,10 @@
Ptpython
********
- `ptpython <http://github.com/jonathanslenders/ptpython/>`_ is an
interactive
+ `ptpython <http://github.com/prompt-toolkit/ptpython/>`_ is an
interactive
Python Shell, build on top of prompt_toolkit.
- .. image ::
https://github.com/jonathanslenders/python-prompt-toolkit/raw/master/docs/images/ptpython.png
+ .. image ::
https://github.com/prompt-toolkit/python-prompt-toolkit/raw/master/docs/images/ptpython.png
prompt_toolkit features
@@ -127,7 +129,7 @@
Shells:
- - `ptpython <http://github.com/jonathanslenders/ptpython/>`_: Python
REPL
+ - `ptpython <http://github.com/prompt-toolkit/ptpython/>`_: Python REPL
- `ptpdb <http://github.com/jonathanslenders/ptpdb/>`_: Python
debugger (pdb replacement)
- `pgcli <http://pgcli.com/>`_: Postgres client.
- `mycli <http://mycli.net>`_: MySql client.
@@ -161,14 +163,14 @@
Full screen applications:
- - `pymux <http://github.com/jonathanslenders/pymux/>`_: A terminal
multiplexer (like tmux) in pure Python.
- - `pyvim <http://github.com/jonathanslenders/pyvim/>`_: A Vim clone in
pure Python.
+ - `pymux <http://github.com/prompt-toolkit/pymux/>`_: A terminal
multiplexer (like tmux) in pure Python.
+ - `pyvim <http://github.com/prompt-toolkit/pyvim/>`_: A Vim clone in
pure Python.
- `freud <http://github.com/stloma/freud/>`_: REST client backed by
SQLite for storing servers
- - `pypager <https://github.com/jonathanslenders/pypager>`_: A $PAGER
in pure Python (like "less").
+ - `pypager <https://github.com/prompt-toolkit/pypager>`_: A $PAGER in
pure Python (like "less").
Libraries:
- - `ptterm <https://github.com/jonathanslenders/ptterm>`_: A terminal
emulator
+ - `ptterm <https://github.com/prompt-toolkit/ptterm>`_: A terminal
emulator
widget for prompt_toolkit.
- `PyInquirer <https://github.com/CITGuru/PyInquirer/>`_: A Python
library that
wants to make it easy for existing Inquirer.js users to write
immersive
@@ -201,21 +203,21 @@
- `Pygments <http://pygments.org/>`_: Syntax highlighter.
- `wcwidth <https://github.com/jquast/wcwidth>`_: Determine columns
needed for a wide characters.
- .. |Build Status| image::
https://api.travis-ci.org/jonathanslenders/python-prompt-toolkit.svg?branch=master
- :target:
https://travis-ci.org/jonathanslenders/python-prompt-toolkit#
+ .. |Build Status| image::
https://api.travis-ci.org/prompt-toolkit/python-prompt-toolkit.svg?branch=master
+ :target:
https://travis-ci.org/prompt-toolkit/python-prompt-toolkit#
.. |PyPI| image:: https://img.shields.io/pypi/v/prompt_toolkit.svg
:target: https://pypi.python.org/pypi/prompt-toolkit/
:alt: Latest Version
.. |AppVeyor| image::
https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva?svg=true
- :target:
https://ci.appveyor.com/project/jonathanslenders/python-prompt-toolkit/
+ :target:
https://ci.appveyor.com/project/prompt-toolkit/python-prompt-toolkit/
.. |RTD| image::
https://readthedocs.org/projects/python-prompt-toolkit/badge/
:target: https://python-prompt-toolkit.readthedocs.io/en/master/
- .. |License| image::
https://img.shields.io/github/license/jonathanslenders/python-prompt-toolkit.svg
- :target:
https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/LICENSE
+ .. |License| image::
https://img.shields.io/github/license/prompt-toolkit/python-prompt-toolkit.svg
+ :target:
https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/LICENSE
Other libraries and implementations in other languages
******************************************************
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/prompt_toolkit-2.0.6/README.rst
new/prompt_toolkit-2.0.7/README.rst
--- old/prompt_toolkit-2.0.6/README.rst 2018-10-12 18:33:16.000000000 +0200
+++ new/prompt_toolkit-2.0.7/README.rst 2018-10-30 22:08:05.000000000 +0100
@@ -3,8 +3,10 @@
|Build Status| |AppVeyor| |PyPI| |RTD| |License|
-``prompt_toolkit`` is a library for building powerful interactive command lines
-and terminal applications in Python.
+.. image ::
https://github.com/prompt-toolkit/python-prompt-toolkit/raw/master/docs/images/logo_400px.png
+
+*``prompt_toolkit`` is a library for building powerful interactive command line
+applications in Python.*
Read the `documentation on readthedocs
<http://python-prompt-toolkit.readthedocs.io/en/stable/>`_.
@@ -21,10 +23,10 @@
Ptpython
********
-`ptpython <http://github.com/jonathanslenders/ptpython/>`_ is an interactive
+`ptpython <http://github.com/prompt-toolkit/ptpython/>`_ is an interactive
Python Shell, build on top of prompt_toolkit.
-.. image ::
https://github.com/jonathanslenders/python-prompt-toolkit/raw/master/docs/images/ptpython.png
+.. image ::
https://github.com/prompt-toolkit/python-prompt-toolkit/raw/master/docs/images/ptpython.png
prompt_toolkit features
@@ -118,7 +120,7 @@
Shells:
-- `ptpython <http://github.com/jonathanslenders/ptpython/>`_: Python REPL
+- `ptpython <http://github.com/prompt-toolkit/ptpython/>`_: Python REPL
- `ptpdb <http://github.com/jonathanslenders/ptpdb/>`_: Python debugger (pdb
replacement)
- `pgcli <http://pgcli.com/>`_: Postgres client.
- `mycli <http://mycli.net>`_: MySql client.
@@ -152,14 +154,14 @@
Full screen applications:
-- `pymux <http://github.com/jonathanslenders/pymux/>`_: A terminal multiplexer
(like tmux) in pure Python.
-- `pyvim <http://github.com/jonathanslenders/pyvim/>`_: A Vim clone in pure
Python.
+- `pymux <http://github.com/prompt-toolkit/pymux/>`_: A terminal multiplexer
(like tmux) in pure Python.
+- `pyvim <http://github.com/prompt-toolkit/pyvim/>`_: A Vim clone in pure
Python.
- `freud <http://github.com/stloma/freud/>`_: REST client backed by SQLite for
storing servers
-- `pypager <https://github.com/jonathanslenders/pypager>`_: A $PAGER in pure
Python (like "less").
+- `pypager <https://github.com/prompt-toolkit/pypager>`_: A $PAGER in pure
Python (like "less").
Libraries:
-- `ptterm <https://github.com/jonathanslenders/ptterm>`_: A terminal emulator
+- `ptterm <https://github.com/prompt-toolkit/ptterm>`_: A terminal emulator
widget for prompt_toolkit.
- `PyInquirer <https://github.com/CITGuru/PyInquirer/>`_: A Python library that
wants to make it easy for existing Inquirer.js users to write immersive
@@ -192,21 +194,21 @@
- `Pygments <http://pygments.org/>`_: Syntax highlighter.
- `wcwidth <https://github.com/jquast/wcwidth>`_: Determine columns needed for
a wide characters.
-.. |Build Status| image::
https://api.travis-ci.org/jonathanslenders/python-prompt-toolkit.svg?branch=master
- :target: https://travis-ci.org/jonathanslenders/python-prompt-toolkit#
+.. |Build Status| image::
https://api.travis-ci.org/prompt-toolkit/python-prompt-toolkit.svg?branch=master
+ :target: https://travis-ci.org/prompt-toolkit/python-prompt-toolkit#
.. |PyPI| image:: https://img.shields.io/pypi/v/prompt_toolkit.svg
:target: https://pypi.python.org/pypi/prompt-toolkit/
:alt: Latest Version
.. |AppVeyor| image::
https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva?svg=true
- :target:
https://ci.appveyor.com/project/jonathanslenders/python-prompt-toolkit/
+ :target:
https://ci.appveyor.com/project/prompt-toolkit/python-prompt-toolkit/
.. |RTD| image:: https://readthedocs.org/projects/python-prompt-toolkit/badge/
:target: https://python-prompt-toolkit.readthedocs.io/en/master/
-.. |License| image::
https://img.shields.io/github/license/jonathanslenders/python-prompt-toolkit.svg
- :target:
https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/LICENSE
+.. |License| image::
https://img.shields.io/github/license/prompt-toolkit/python-prompt-toolkit.svg
+ :target:
https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/LICENSE
Other libraries and implementations in other languages
******************************************************
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/examples/full-screen/simple-demos/horizontal-align.py
new/prompt_toolkit-2.0.7/examples/full-screen/simple-demos/horizontal-align.py
---
old/prompt_toolkit-2.0.6/examples/full-screen/simple-demos/horizontal-align.py
1970-01-01 01:00:00.000000000 +0100
+++
new/prompt_toolkit-2.0.7/examples/full-screen/simple-demos/horizontal-align.py
2018-10-22 20:56:21.000000000 +0200
@@ -0,0 +1,98 @@
+#!/usr/bin/env python
+"""
+Horizontal align demo with HSplit.
+"""
+from __future__ import unicode_literals
+
+from prompt_toolkit.application import Application
+from prompt_toolkit.formatted_text import HTML
+from prompt_toolkit.key_binding import KeyBindings
+from prompt_toolkit.layout.containers import HSplit, VSplit, Window,
HorizontalAlign, VerticalAlign, WindowAlign
+from prompt_toolkit.layout.controls import FormattedTextControl
+from prompt_toolkit.layout.dimension import D
+from prompt_toolkit.layout.layout import Layout
+from prompt_toolkit.widgets import Frame
+
+TITLE = HTML(""" <u>HSplit HorizontalAlign</u> example.
+ Press <b>'q'</b> to quit.""")
+
+LIPSUM = """\
+Lorem ipsum dolor
+sit amet, consectetur
+adipiscing elit.
+Maecenas quis
+interdum enim."""
+
+
+# 1. The layout
+body = HSplit([
+ Frame(
+ Window(FormattedTextControl(TITLE), height=2), style='bg:#88ff88
#000000'),
+ HSplit([
+ # Left alignment.
+ VSplit([
+ Window(FormattedTextControl(HTML('<u>LEFT</u>')), width=10,
+ ignore_content_width=True, style='bg:#ff3333 ansiblack',
align=WindowAlign.CENTER),
+ VSplit([
+ Window(FormattedTextControl(LIPSUM), height=4,
style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), height=4,
style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), height=4,
style='bg:#444488'),
+ ], padding=1, padding_style='bg:#888888',
align=HorizontalAlign.LEFT, height=5, padding_char='|'),
+ ]),
+ # Center alignment.
+ VSplit([
+ Window(FormattedTextControl(HTML('<u>CENTER</u>')), width=10,
+ ignore_content_width=True, style='bg:#ff3333 ansiblack',
align=WindowAlign.CENTER),
+ VSplit([
+ Window(FormattedTextControl(LIPSUM), height=4,
style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), height=4,
style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), height=4,
style='bg:#444488'),
+ ], padding=1, padding_style='bg:#888888',
align=HorizontalAlign.CENTER, height=5, padding_char='|'),
+ ]),
+ # Right alignment.
+ VSplit([
+ Window(FormattedTextControl(HTML('<u>RIGHT</u>')), width=10,
+ ignore_content_width=True, style='bg:#ff3333 ansiblack',
align=WindowAlign.CENTER),
+ VSplit([
+ Window(FormattedTextControl(LIPSUM), height=4,
style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), height=4,
style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), height=4,
style='bg:#444488'),
+ ], padding=1, padding_style='bg:#888888',
align=HorizontalAlign.RIGHT, height=5, padding_char='|'),
+ ]),
+ # Justify
+ VSplit([
+ Window(FormattedTextControl(HTML('<u>JUSTIFY</u>')), width=10,
+ ignore_content_width=True, style='bg:#ff3333 ansiblack',
align=WindowAlign.CENTER),
+ VSplit([
+ Window(FormattedTextControl(LIPSUM), style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), style='bg:#444488'),
+ ], padding=1, padding_style='bg:#888888',
align=HorizontalAlign.JUSTIFY, height=5, padding_char='|'),
+ ]),
+ ], padding=1, padding_style="bg:#ff3333 #ffffff", padding_char='.',
align=VerticalAlign.TOP)
+])
+
+
+# 2. Key bindings
+kb = KeyBindings()
+
+
[email protected]('q')
+def _(event):
+ " Quit application. "
+ event.app.exit()
+
+
+# 3. The `Application`
+application = Application(
+ layout=Layout(body),
+ key_bindings=kb,
+ full_screen=True)
+
+
+def run():
+ application.run()
+
+
+if __name__ == '__main__':
+ run()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/examples/full-screen/simple-demos/vertical-align.py
new/prompt_toolkit-2.0.7/examples/full-screen/simple-demos/vertical-align.py
---
old/prompt_toolkit-2.0.6/examples/full-screen/simple-demos/vertical-align.py
1970-01-01 01:00:00.000000000 +0100
+++
new/prompt_toolkit-2.0.7/examples/full-screen/simple-demos/vertical-align.py
2018-10-22 20:56:21.000000000 +0200
@@ -0,0 +1,90 @@
+#!/usr/bin/env python
+"""
+Vertical align demo with VSplit.
+"""
+from __future__ import unicode_literals
+
+from prompt_toolkit.application import Application
+from prompt_toolkit.formatted_text import HTML
+from prompt_toolkit.key_binding import KeyBindings
+from prompt_toolkit.layout.containers import HSplit, VSplit, Window,
VerticalAlign, WindowAlign
+from prompt_toolkit.layout.controls import FormattedTextControl
+from prompt_toolkit.layout.layout import Layout
+from prompt_toolkit.layout.dimension import D
+from prompt_toolkit.widgets import Frame
+
+TITLE = HTML(""" <u>VSplit VerticalAlign</u> example.
+ Press <b>'q'</b> to quit.""")
+
+LIPSUM = """
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
+quis interdum enim. Nam viverra, mauris et blandit malesuada, ante est bibendum
+mauris, ac dignissim dui tellus quis ligula. Aenean condimentum leo at
+dignissim placerat."""
+
+# 1. The layout
+body = HSplit([
+ Frame(
+ Window(FormattedTextControl(TITLE), height=2), style='bg:#88ff88
#000000'),
+ VSplit([
+ Window(FormattedTextControl(HTML(' <u>VerticalAlign.TOP</u>')),
height=4,
+ ignore_content_width=True, style='bg:#ff3333 #000000 bold',
align=WindowAlign.CENTER),
+ Window(FormattedTextControl(HTML(' <u>VerticalAlign.CENTER</u>')),
height=4,
+ ignore_content_width=True, style='bg:#ff3333 #000000 bold',
align=WindowAlign.CENTER),
+ Window(FormattedTextControl(HTML(' <u>VerticalAlign.BOTTOM</u>')),
height=4,
+ ignore_content_width=True, style='bg:#ff3333 #000000 bold',
align=WindowAlign.CENTER),
+ Window(FormattedTextControl(HTML(' <u>VerticalAlign.JUSTIFY</u>')),
height=4,
+ ignore_content_width=True, style='bg:#ff3333 #000000 bold',
align=WindowAlign.CENTER),
+ ], height=1, padding=1, padding_style='bg:#ff3333'),
+ VSplit([
+ # Top alignment.
+ HSplit([
+ Window(FormattedTextControl(LIPSUM), height=4, style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), height=4, style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), height=4, style='bg:#444488'),
+ ], padding=1, padding_style='bg:#888888', align=VerticalAlign.TOP,
padding_char='~'),
+ # Center alignment.
+ HSplit([
+ Window(FormattedTextControl(LIPSUM), height=4, style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), height=4, style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), height=4, style='bg:#444488'),
+ ], padding=1, padding_style='bg:#888888', align=VerticalAlign.CENTER,
padding_char='~'),
+ # Bottom alignment.
+ HSplit([
+ Window(FormattedTextControl(LIPSUM), height=4, style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), height=4, style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), height=4, style='bg:#444488'),
+ ], padding=1, padding_style='bg:#888888', align=VerticalAlign.BOTTOM,
padding_char='~'),
+ # Justify
+ HSplit([
+ Window(FormattedTextControl(LIPSUM), style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), style='bg:#444488'),
+ Window(FormattedTextControl(LIPSUM), style='bg:#444488'),
+ ], padding=1, padding_style='bg:#888888', align=VerticalAlign.JUSTIFY,
padding_char='~'),
+ ], padding=1, padding_style="bg:#ff3333 #ffffff", padding_char='.')
+])
+
+
+# 2. Key bindings
+kb = KeyBindings()
+
+
[email protected]('q')
+def _(event):
+ " Quit application. "
+ event.app.exit()
+
+
+# 3. The `Application`
+application = Application(
+ layout=Layout(body),
+ key_bindings=kb,
+ full_screen=True)
+
+
+def run():
+ application.run()
+
+
+if __name__ == '__main__':
+ run()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/examples/print-text/print-frame.py
new/prompt_toolkit-2.0.7/examples/print-text/print-frame.py
--- old/prompt_toolkit-2.0.6/examples/print-text/print-frame.py 1970-01-01
01:00:00.000000000 +0100
+++ new/prompt_toolkit-2.0.7/examples/print-text/print-frame.py 2018-10-30
22:08:05.000000000 +0100
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+"""
+Example usage of 'print_container', a tool to print
+any layout in a non-interactive way.
+"""
+from __future__ import unicode_literals, print_function
+from prompt_toolkit.shortcuts import print_container
+from prompt_toolkit.widgets import Frame, TextArea
+
+
+print_container(
+ Frame(
+ TextArea(text='Hello world!\n'),
+ title='Stage: parse',
+ ))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/prompt_toolkit-2.0.6/prompt_toolkit/__init__.py
new/prompt_toolkit-2.0.7/prompt_toolkit/__init__.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/__init__.py 2018-10-12
18:47:32.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/__init__.py 2018-10-30
22:20:11.000000000 +0100
@@ -20,7 +20,7 @@
# Don't forget to update in `docs/conf.py`!
-__version__ = '2.0.6'
+__version__ = '2.0.7'
# Version tuple.
VERSION = tuple(__version__.split('.'))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/application/application.py
new/prompt_toolkit-2.0.7/prompt_toolkit/application/application.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/application/application.py
2018-10-12 18:33:16.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/application/application.py
2018-10-22 20:56:21.000000000 +0200
@@ -240,6 +240,7 @@
self.renderer = Renderer(
self._merged_style,
self.output,
+ self.input,
full_screen=full_screen,
mouse_support=mouse_support,
cpr_not_supported_callback=self.cpr_not_supported_callback)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/eventloop/coroutine.py
new/prompt_toolkit-2.0.7/prompt_toolkit/eventloop/coroutine.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/eventloop/coroutine.py
2018-07-22 17:33:30.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/eventloop/coroutine.py
2018-10-30 22:08:05.000000000 +0100
@@ -90,7 +90,7 @@
new_f = coroutine.throw(exc)
else:
new_f = coroutine.send(f.result())
- except StopIteration as e:
+ except StopIteration:
# Stop coroutine. Make sure that a result has been set in the
future,
# this will call the callbacks. (Also, don't take any result from
# StopIteration, it has already been set using `raise Return()`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/formatted_text/ansi.py
new/prompt_toolkit-2.0.7/prompt_toolkit/formatted_text/ansi.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/formatted_text/ansi.py
2018-09-23 20:34:28.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/formatted_text/ansi.py
2018-10-30 22:08:05.000000000 +0100
@@ -1,6 +1,7 @@
from __future__ import unicode_literals
from prompt_toolkit.output.vt100 import FG_ANSI_COLORS, BG_ANSI_COLORS
from prompt_toolkit.output.vt100 import _256_colors as _256_colors_table
+from .base import FormattedText
__all__ = [
'ANSI',
@@ -24,7 +25,7 @@
"""
def __init__(self, value):
self.value = value
- self._formatted_text = []
+ self._formatted_text = FormattedText()
# Default style attributes.
self._color = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/formatted_text/base.py
new/prompt_toolkit-2.0.7/prompt_toolkit/formatted_text/base.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/formatted_text/base.py
2018-06-02 18:59:41.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/formatted_text/base.py
2018-10-30 22:08:05.000000000 +0100
@@ -15,7 +15,7 @@
"""
Convert the given value (which can be formatted text) into a list of text
fragments. (Which is the canonical form of formatted text.) The outcome is
- supposed to be a list of (style, text) tuples.
+ always a `FormattedText` instance, which is a list of (style, text) tuples.
It can take an `HTML` object, a plain text string, or anything that
implements `__pt_formatted_text__`.
@@ -55,12 +55,19 @@
result = [(style + ' ' + k, v) for k, v in result]
except ValueError:
# Too many values to unpack:
- # If the above failed, try the slower version (amost twice as
+ # If the above failed, try the slower version (almost twice as
# slow) which supports multiple items. This is used in the
# `to_formatted_text` call in `FormattedTextControl` which also
# accepts (style, text, mouse_handler) tuples.
result = [(style + ' ' + item[0], ) + item[1:] for item in result]
- return result
+
+ # Make sure the result is wrapped in a `FormattedText`. Among other
+ # reasons, this is important for `print_formatted_text` to work correctly
+ # and distinguish between lists and formatted text.
+ if isinstance(result, FormattedText):
+ return result
+ else:
+ return FormattedText(result)
def is_formatted_text(value):
@@ -78,23 +85,19 @@
return False
-class FormattedText(object):
+class FormattedText(list):
"""
A list of ``(style, text)`` tuples.
- """
- def __init__(self, data):
- self.data = data
-
- # Validate the first tuple only.
- if len(self.data):
- assert isinstance(self.data[0][0], six.text_type)
- assert isinstance(self.data[0][1], six.text_type)
+ (In some situations, this can also be ``(style, text, mouse_handler)``
+ tuples.)
+ """
def __pt_formatted_text__(self):
- return self.data
+ return self
def __repr__(self):
- return 'FormattedText(%r)' % (self.data, )
+ return 'FormattedText(%s)' % (
+ super(FormattedText, self).__repr__())
class Template(object):
@@ -120,7 +123,7 @@
parts = self.text.split('{}')
assert len(parts) - 1 == len(values)
- result = []
+ result = FormattedText()
for part, val in zip(parts, values):
result.append(('', part))
result.extend(to_formatted_text(val))
@@ -136,7 +139,7 @@
assert all(is_formatted_text(v) for v in items)
def _merge_formatted_text():
- result = []
+ result = FormattedText()
for i in items:
result.extend(to_formatted_text(i))
return result
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/formatted_text/html.py
new/prompt_toolkit-2.0.7/prompt_toolkit/formatted_text/html.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/formatted_text/html.py
2018-06-02 18:59:41.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/formatted_text/html.py
2018-10-30 22:08:05.000000000 +0100
@@ -1,6 +1,7 @@
from __future__ import unicode_literals
import six
import xml.dom.minidom as minidom
+from .base import FormattedText
__all__ = [
'HTML'
@@ -79,7 +80,7 @@
process_node(document)
- self.formatted_text = result
+ self.formatted_text = FormattedText(result)
def __repr__(self):
return 'HTML(%r)' % (self.value, )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/formatted_text/pygments.py
new/prompt_toolkit-2.0.7/prompt_toolkit/formatted_text/pygments.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/formatted_text/pygments.py
2018-06-02 18:59:41.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/formatted_text/pygments.py
2018-10-30 22:08:05.000000000 +0100
@@ -1,5 +1,6 @@
from __future__ import unicode_literals
from prompt_toolkit.styles.pygments import pygments_token_to_classname
+from .base import FormattedText
__all__ = [
'PygmentsTokens',
@@ -16,7 +17,7 @@
self.token_list = token_list
def __pt_formatted_text__(self):
- result = []
+ result = FormattedText()
for token, text in self.token_list:
result.append(('class:' + pygments_token_to_classname(token),
text))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/prompt_toolkit-2.0.6/prompt_toolkit/input/vt100.py
new/prompt_toolkit-2.0.7/prompt_toolkit/input/vt100.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/input/vt100.py 2018-07-22
17:33:30.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/input/vt100.py 2018-10-22
20:56:21.000000000 +0200
@@ -23,10 +23,10 @@
Vt100 input for Posix systems.
(This uses a posix file descriptor that can be registered in the event
loop.)
"""
- def __init__(self, stdin):
- # The input object should be a TTY.
- assert stdin.isatty()
+ _fds_not_a_terminal = set() # For the error messages. Only display "Input
+ # is not a terminal" once per file descriptor.
+ def __init__(self, stdin):
# Test whether the given input object has a file descriptor.
# (Idle reports stdin to be a TTY, but fileno() is not implemented.)
try:
@@ -39,6 +39,20 @@
else:
raise io.UnsupportedOperation('Stdin is not a terminal.')
+ # Even when we have a file descriptor, it doesn't mean it's a TTY.
+ # Normally, this requires a real TTY device, but people instantiate
+ # this class often during unit tests as well. They use for instance
+ # pexpect to pipe data into an application. For convenience, we print
+ # an error message and go on.
+ isatty = stdin.isatty()
+ fd = stdin.fileno()
+
+ if not isatty and fd not in Vt100Input._fds_not_a_terminal:
+ msg = 'Warning: Input is not to a terminal (fd=%r).\n'
+ sys.stderr.write(msg % fd)
+ Vt100Input._fds_not_a_terminal.add(fd)
+
+ #
self.stdin = stdin
# Create a backup of the fileno(). We want this to work even if the
@@ -52,7 +66,9 @@
@property
def responds_to_cpr(self):
- return True
+ # When the input is a tty, we assume that CPR is supported.
+ # It's not when the input is piped from Pexpect.
+ return self.stdin.isatty()
def attach(self, input_ready_callback):
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/key_binding/bindings/basic.py
new/prompt_toolkit-2.0.7/prompt_toolkit/key_binding/bindings/basic.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/key_binding/bindings/basic.py
2018-06-02 18:59:41.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/key_binding/bindings/basic.py
2018-10-22 20:56:21.000000000 +0200
@@ -131,10 +131,13 @@
handle(Keys.Any, filter=insert_mode, save_before=if_no_repeat)(
get_by_name('self-insert'))
handle('c-t', filter=insert_mode)(get_by_name('transpose-chars'))
- handle('c-w', filter=insert_mode)(get_by_name('unix-word-rubout'))
handle('c-i', filter=insert_mode)(get_by_name('menu-complete'))
handle('s-tab', filter=insert_mode)(get_by_name('menu-complete-backward'))
+ # Control-W should delete, using whitespace as separator, while M-Del
+ # should delete using [^a-zA-Z0-9] as a boundary.
+ handle('c-w', filter=insert_mode)(get_by_name('unix-word-rubout'))
+
handle('pageup', filter= ~has_selection)(get_by_name('previous-history'))
handle('pagedown', filter= ~has_selection)(get_by_name('next-history'))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/key_binding/bindings/vi.py
new/prompt_toolkit-2.0.7/prompt_toolkit/key_binding/bindings/vi.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/key_binding/bindings/vi.py
2018-09-23 20:34:28.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/key_binding/bindings/vi.py
2018-10-22 20:56:21.000000000 +0200
@@ -472,6 +472,11 @@
" Pressing the Insert key. "
event.app.vi_state.input_mode = InputMode.INSERT
+ @handle('insert', filter=vi_insert_mode)
+ def _(event):
+ " Pressing the Insert key. "
+ event.app.vi_state.input_mode = InputMode.NAVIGATION
+
@handle('a', filter=vi_navigation_mode & ~is_read_only)
# ~IsReadOnly, because we want to stay in navigation mode for
# read-only buffers.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/key_binding/key_processor.py
new/prompt_toolkit-2.0.7/prompt_toolkit/key_binding/key_processor.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/key_binding/key_processor.py
2018-09-23 20:34:28.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/key_binding/key_processor.py
2018-10-30 22:08:05.000000000 +0100
@@ -325,8 +325,8 @@
except EditReadOnlyBuffer:
# When a key binding does an attempt to change a buffer which is
- # read-only, we can just silently ignore that.
- pass
+ # read-only, we can ignore that. We sound a bell and go on.
+ app.output.bell()
if was_temporary_navigation_mode:
self._leave_vi_temp_navigation_mode(event)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/layout/containers.py
new/prompt_toolkit-2.0.7/prompt_toolkit/layout/containers.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/layout/containers.py
2018-10-04 15:29:38.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/layout/containers.py
2018-10-22 20:56:21.000000000 +0200
@@ -23,6 +23,11 @@
from prompt_toolkit.mouse_events import MouseEvent, MouseEventType
from prompt_toolkit.utils import take_using_weights, get_cwidth, to_int, to_str
+try:
+ from collections.abc import Sequence
+except ImportError:
+ from collections import Sequence
+
__all__ = [
'Container',
'HorizontalAlign',
@@ -138,7 +143,7 @@
padding_style='', width=None, height=None, z_index=None,
modal=False, key_bindings=None, style=''):
assert window_too_small is None or isinstance(window_too_small,
Container)
- assert isinstance(children, list)
+ assert isinstance(children, Sequence)
assert isinstance(modal, bool)
assert callable(style) or isinstance(style, text_type)
assert is_dimension(width)
@@ -182,10 +187,17 @@
| |
+--------------------+
+ By default, this doesn't display a horizontal line between the children,
+ but if this is something you need, then create a HSplit as follows::
+
+ HSplit(children=[ ... ], padding_char='-',
+ padding=1, padding_style='#ffff00')
+
:param children: List of child :class:`.Container` objects.
:param window_too_small: A :class:`.Container` object that is displayed if
there is not enough space for all the children. By default, this is a
"Window too small" message.
+ :param align: `VerticalAlign` value.
:param width: When given, use this width instead of looking at the
children.
:param height: When given, use this height instead of looking at the
children.
:param z_index: (int or None) When specified, this can be used to bring
@@ -193,6 +205,10 @@
:param style: A style string.
:param modal: ``True`` or ``False``.
:param key_bindings: ``None`` or a :class:`.KeyBindings` object.
+
+ :param padding: (`Dimension` or int), size to be used for the padding.
+ :param padding_char: Character to be used for filling in the padding.
+ :param padding_style: Style to applied to the padding.
"""
def __init__(self, children, window_too_small=None,
align=VerticalAlign.JUSTIFY, padding=0, padding_char=None,
@@ -367,10 +383,17 @@
| | |
+---------+----------+
+ By default, this doesn't display a vertical line between the children, but
+ if this is something you need, then create a HSplit as follows::
+
+ VSplit(children=[ ... ], padding_char='|',
+ padding=1, padding_style='#ffff00')
+
:param children: List of child :class:`.Container` objects.
:param window_too_small: A :class:`.Container` object that is displayed if
there is not enough space for all the children. By default, this is a
"Window too small" message.
+ :param align: `HorizontalAlign` value.
:param width: When given, use this width instead of looking at the
children.
:param height: When given, use this height instead of looking at the
children.
:param z_index: (int or None) When specified, this can be used to bring
@@ -378,6 +401,10 @@
:param style: A style string.
:param modal: ``True`` or ``False``.
:param key_bindings: ``None`` or a :class:`.KeyBindings` object.
+
+ :param padding: (`Dimension` or int), size to be used for the padding.
+ :param padding_char: Character to be used for filling in the padding.
+ :param padding_style: Style to applied to the padding.
"""
def __init__(self, children, window_too_small=None,
align=HorizontalAlign.JUSTIFY,
padding=Dimension.exact(0), padding_char=None,
@@ -1119,7 +1146,13 @@
class WindowAlign:
- " Alignment of Window content. "
+ """
+ Alignment of the Window content.
+
+ Note that this is different from `HorizontalAlign` and `VerticalAlign`,
+ which are used for the alignment of the child containers in respectively
+ `VSplit` and `HSplit`.
+ """
LEFT = 'LEFT'
RIGHT = 'RIGHT'
CENTER = 'CENTER'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/layout/margins.py
new/prompt_toolkit-2.0.7/prompt_toolkit/layout/margins.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/layout/margins.py 2018-09-30
19:32:13.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/layout/margins.py 2018-10-30
22:08:05.000000000 +0100
@@ -144,8 +144,10 @@
:param display_arrows: Display scroll up/down arrows.
"""
- def __init__(self, display_arrows=False):
+ def __init__(self, display_arrows=False, up_arrow_symbol='^',
down_arrow_symbol='v'):
self.display_arrows = to_filter(display_arrows)
+ self.up_arrow_symbol = up_arrow_symbol
+ self.down_arrow_symbol = down_arrow_symbol
def get_width(self, ui_content):
return 1
@@ -175,7 +177,7 @@
result = []
if display_arrows:
result.extend([
- ('class:scrollbar.arrow', '^'),
+ ('class:scrollbar.arrow', self.up_arrow_symbol),
('class:scrollbar', '\n')
])
@@ -202,7 +204,7 @@
# Down arrow
if display_arrows:
- result.append(('class:scrollbar.arrow', 'v'))
+ result.append(('class:scrollbar.arrow',
self.down_arrow_symbol))
return result
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/prompt_toolkit-2.0.6/prompt_toolkit/output/vt100.py
new/prompt_toolkit-2.0.7/prompt_toolkit/output/vt100.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/output/vt100.py 2018-10-12
18:33:16.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/output/vt100.py 2018-10-22
20:56:21.000000000 +0200
@@ -18,6 +18,7 @@
import array
import errno
import six
+import sys
__all__ = [
'Vt100_Output',
@@ -380,6 +381,9 @@
:param write_binary: Encode the output before writing it. If `True` (the
default), the `stdout` object is supposed to expose an `encoding`
attribute.
"""
+ _fds_not_a_terminal = set() # For the error messages. Only display "Output
+ # is not a terminal" once per file descriptor.
+
def __init__(self, stdout, get_size, term=None, write_binary=True):
assert callable(get_size)
assert term is None or isinstance(term, six.text_type)
@@ -409,11 +413,23 @@
(This will take the dimensions by reading the pseudo
terminal attributes.)
"""
- assert stdout.isatty()
+ # Normally, this requires a real TTY device, but people instantiate
+ # this class often during unit tests as well. For convenience, we print
+ # an error message, use standard dimensions, and go on.
+ isatty = stdout.isatty()
+ fd = stdout.fileno()
+
+ if not isatty and fd not in cls._fds_not_a_terminal:
+ msg = 'Warning: Output is not to a terminal (fd=%r).\n'
+ sys.stderr.write(msg % fd)
+ cls._fds_not_a_terminal.add(fd)
def get_size():
- rows, columns = _get_size(stdout.fileno())
- return Size(rows=rows, columns=columns)
+ if isatty:
+ rows, columns = _get_size(stdout.fileno())
+ return Size(rows=rows, columns=columns)
+ else:
+ return Size(rows=24, columns=80)
return cls(stdout, get_size, term=term)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/prompt_toolkit-2.0.6/prompt_toolkit/renderer.py
new/prompt_toolkit-2.0.7/prompt_toolkit/renderer.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/renderer.py 2018-10-12
18:33:16.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/renderer.py 2018-10-22
20:56:21.000000000 +0200
@@ -7,6 +7,7 @@
from prompt_toolkit.eventloop import Future, From, ensure_future,
get_event_loop
from prompt_toolkit.filters import to_filter
from prompt_toolkit.formatted_text import to_formatted_text
+from prompt_toolkit.input.base import Input
from prompt_toolkit.layout.mouse_handlers import MouseHandlers
from prompt_toolkit.layout.screen import Point, Screen, WritePosition
from prompt_toolkit.output import Output, ColorDepth
@@ -265,13 +266,17 @@
"""
CPR_TIMEOUT = 2 # Time to wait until we consider CPR to be not supported.
- def __init__(self, style, output, full_screen=False, mouse_support=False,
cpr_not_supported_callback=None):
+ def __init__(self, style, output, input, full_screen=False,
+ mouse_support=False, cpr_not_supported_callback=None):
+
assert isinstance(style, BaseStyle)
assert isinstance(output, Output)
+ assert isinstance(input, Input)
assert callable(cpr_not_supported_callback) or
cpr_not_supported_callback is None
self.style = style
self.output = output
+ self.input = input
self.full_screen = full_screen
self.mouse_support = to_filter(mouse_support)
self.cpr_not_supported_callback = cpr_not_supported_callback
@@ -283,6 +288,8 @@
# Future set when we are waiting for a CPR flag.
self._waiting_for_cpr_futures = deque()
self.cpr_support = CPR_Support.UNKNOWN
+ if not input.responds_to_cpr:
+ self.cpr_support = CPR_Support.NOT_SUPPORTED
# Cache for the style.
self._attrs_for_style = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/shortcuts/__init__.py
new/prompt_toolkit-2.0.7/prompt_toolkit/shortcuts/__init__.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/shortcuts/__init__.py
2018-06-02 18:59:41.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/shortcuts/__init__.py
2018-10-22 20:56:21.000000000 +0200
@@ -1,7 +1,7 @@
from __future__ import unicode_literals
from .dialogs import yes_no_dialog, button_dialog, input_dialog,
message_dialog, radiolist_dialog, progress_dialog
from .prompt import PromptSession, prompt, confirm, create_confirm_session,
CompleteStyle
-from .utils import print_formatted_text, clear, set_title, clear_title
+from .utils import print_formatted_text, print_container, clear, set_title,
clear_title
from .progress_bar import ProgressBar
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/shortcuts/dialogs.py
new/prompt_toolkit-2.0.7/prompt_toolkit/shortcuts/dialogs.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/shortcuts/dialogs.py
2018-07-22 17:33:30.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/shortcuts/dialogs.py
2018-10-30 22:08:05.000000000 +0100
@@ -70,6 +70,7 @@
"""
def accept(buf):
get_app().layout.focus(ok_button)
+ return True # Keep text.
def ok_handler():
get_app().exit(result=textfield.text)
@@ -113,7 +114,10 @@
def radiolist_dialog(title='', text='', ok_text='Ok', cancel_text='Cancel',
values=None, style=None, async_=False):
"""
- Display a simple message box and wait until the user presses enter.
+ Display a simple list of element the user can choose amongst.
+
+ Only one element can be selected at a time using Arrow keys and Enter.
+ The focus can be moved between the list and the Ok/Cancel button with tab.
"""
def ok_handler():
get_app().exit(result=radio_list.current_value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/shortcuts/prompt.py
new/prompt_toolkit-2.0.7/prompt_toolkit/shortcuts/prompt.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/shortcuts/prompt.py 2018-10-12
18:33:16.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/shortcuts/prompt.py 2018-10-13
23:21:56.000000000 +0200
@@ -216,8 +216,6 @@
``CompleteStyle.MULTI_COLUMN`` or ``CompleteStyle.READLINE_LIKE``.
:param mouse_support: `bool` or :class:`~prompt_toolkit.filters.Filter`
to enable mouse support.
- :param default: The default input text to be shown. (This can be edited by
- the user).
:param refresh_interval: (number; in seconds) When given, refresh the UI
every so many seconds.
:param inputhook: None or an Inputhook callable that takes an
@@ -232,14 +230,13 @@
'enable_history_search', 'search_ignore_case', 'complete_while_typing',
'validate_while_typing', 'complete_style', 'mouse_support',
'auto_suggest', 'clipboard', 'validator', 'refresh_interval',
- 'input_processors', 'default', 'enable_system_prompt',
- 'enable_suspend', 'enable_open_in_editor', 'reserve_space_for_menu',
- 'tempfile_suffix', 'inputhook')
+ 'input_processors', 'enable_system_prompt', 'enable_suspend',
+ 'enable_open_in_editor', 'reserve_space_for_menu', 'tempfile_suffix',
+ 'inputhook')
def __init__(
self,
message='',
- default='',
multiline=False,
wrap_lines=True,
is_password=False,
@@ -280,7 +277,7 @@
input=None,
output=None):
assert style is None or isinstance(style, BaseStyle)
- assert style_transformation is None or isinstance(style,
StyleTransformation)
+ assert style_transformation is None or
isinstance(style_transformation, StyleTransformation)
assert input_processors is None or isinstance(input_processors, list)
assert key_bindings is None or isinstance(key_bindings,
KeyBindingsBase)
@@ -651,24 +648,27 @@
done[0] = True
def prompt(
- self, message=None,
+ self,
# When any of these arguments are passed, this value is overwritten
- # for the current prompt.
- default='', editing_mode=None,
- refresh_interval=None, vi_mode=None, lexer=None, completer=None,
- complete_in_thread=None, is_password=None, key_bindings=None,
- bottom_toolbar=None, style=None, color_depth=None,
- include_default_pygments_style=None, style_transformation=None,
- swap_light_and_dark_colors=None, rprompt=None, multiline=None,
- prompt_continuation=None, wrap_lines=None,
- enable_history_search=None, search_ignore_case=None,
- complete_while_typing=None, validate_while_typing=None,
- complete_style=None, auto_suggest=None, validator=None,
- clipboard=None, mouse_support=None, input_processors=None,
- reserve_space_for_menu=None, enable_system_prompt=None,
- enable_suspend=None, enable_open_in_editor=None,
- tempfile_suffix=None, inputhook=None,
- async_=False, accept_default=False, pre_run=None):
+ # in this PromptSession.
+ message=None, # `message` should go first, because people call it
+ # as positional argument.
+ editing_mode=None, refresh_interval=None, vi_mode=None, lexer=None,
+ completer=None, complete_in_thread=None, is_password=None,
+ key_bindings=None, bottom_toolbar=None, style=None,
+ color_depth=None, include_default_pygments_style=None,
+ style_transformation=None, swap_light_and_dark_colors=None,
+ rprompt=None, multiline=None, prompt_continuation=None,
+ wrap_lines=None, enable_history_search=None,
+ search_ignore_case=None, complete_while_typing=None,
+ validate_while_typing=None, complete_style=None, auto_suggest=None,
+ validator=None, clipboard=None, mouse_support=None,
+ input_processors=None, reserve_space_for_menu=None,
+ enable_system_prompt=None, enable_suspend=None,
+ enable_open_in_editor=None, tempfile_suffix=None, inputhook=None,
+
+ # Following arguments are specific to the current `prompt()` call.
+ async_=False, default='', accept_default=False, pre_run=None):
"""
Display the prompt. All the arguments are a subset of the
:class:`~.PromptSession` class itself.
@@ -677,12 +677,18 @@
(for abort) and ``EOFError`` when control-d has been pressed (for
exit).
+ Additional arguments, specific for this prompt:
+
:param async_: When `True` return a `Future` instead of waiting for the
prompt to finish.
+ :param default: The default input text to be shown. (This can be edited
+ by the user).
:param accept_default: When `True`, automatically accept the default
value without allowing the user to edit the input.
:param pre_run: Callable, called at the start of `Application.run`.
"""
+ assert isinstance(default, text_type)
+
# NOTE: We used to create a backup of the PromptSession attributes and
# restore them after exiting the prompt. This code has been
# removed, because it was confusing and didn't really serve a use
@@ -712,12 +718,12 @@
def run_sync():
with self._auto_refresh_context():
- self.default_buffer.reset(Document(self.default))
+ self.default_buffer.reset(Document(default))
return self.app.run(inputhook=self.inputhook, pre_run=pre_run2)
def run_async():
with self._auto_refresh_context():
- self.default_buffer.reset(Document(self.default))
+ self.default_buffer.reset(Document(default))
result = yield From(self.app.run_async(pre_run=pre_run2))
raise Return(result)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit/shortcuts/utils.py
new/prompt_toolkit-2.0.7/prompt_toolkit/shortcuts/utils.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/shortcuts/utils.py 2018-10-12
18:33:16.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/shortcuts/utils.py 2018-10-30
22:08:05.000000000 +0100
@@ -1,5 +1,8 @@
from __future__ import unicode_literals, print_function
-from prompt_toolkit.formatted_text import to_formatted_text
+from prompt_toolkit.application import Application
+from prompt_toolkit.eventloop import get_event_loop
+from prompt_toolkit.formatted_text import to_formatted_text, FormattedText
+from prompt_toolkit.layout import Layout
from prompt_toolkit.output import Output, ColorDepth
from prompt_toolkit.output.defaults import create_output, get_default_output
from prompt_toolkit.renderer import print_formatted_text as
renderer_print_formatted_text
@@ -8,6 +11,7 @@
__all__ = [
'print_formatted_text',
+ 'print_container',
'clear',
'set_title',
'clear_title',
@@ -98,7 +102,9 @@
# Merges values.
def to_text(val):
- if isinstance(val, list):
+ # Normal lists which are not instances of `FormattedText` are
+ # considered plain text.
+ if isinstance(val, list) and not isinstance(val, FormattedText):
return to_formatted_text('{0}'.format(val))
return to_formatted_text(val, auto_convert=True)
@@ -121,6 +127,33 @@
output.flush()
+def print_container(container, file=None):
+ """
+ Print any layout to the output in a non-interactive way.
+
+ Example usage::
+
+ from prompt_toolkit.widgets import Frame, TextArea
+ print_container(
+ Frame(TextArea(text='Hello world!')))
+ """
+ if file:
+ output = create_output(stdout=file)
+ else:
+ output = get_default_output()
+
+ def exit_immediately():
+ # Use `call_from_executor` to exit "soon", so that we still render one
+ # initial time, before exiting the application.
+ get_event_loop().call_from_executor(
+ lambda: app.exit())
+
+ app = Application(
+ layout=Layout(container=container),
+ output=output)
+ app.run(pre_run=exit_immediately)
+
+
def clear():
"""
Clear the screen.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/prompt_toolkit-2.0.6/prompt_toolkit/widgets/base.py
new/prompt_toolkit-2.0.7/prompt_toolkit/widgets/base.py
--- old/prompt_toolkit-2.0.6/prompt_toolkit/widgets/base.py 2018-10-12
18:33:16.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit/widgets/base.py 2018-10-30
22:08:05.000000000 +0100
@@ -582,6 +582,22 @@
self._selected_index = min(
len(self.values) - 1, self._selected_index + 1)
+ @kb.add('pageup')
+ def _(event):
+ w = event.app.layout.current_window
+ self._selected_index = max(
+ 0,
+ self._selected_index - len(w.render_info.displayed_lines)
+ )
+
+ @kb.add('pagedown')
+ def _(event):
+ w = event.app.layout.current_window
+ self._selected_index = min(
+ len(self.values) - 1,
+ self._selected_index + len(w.render_info.displayed_lines)
+ )
+
@kb.add('enter')
@kb.add(' ')
def _(event):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit.egg-info/PKG-INFO
new/prompt_toolkit-2.0.7/prompt_toolkit.egg-info/PKG-INFO
--- old/prompt_toolkit-2.0.6/prompt_toolkit.egg-info/PKG-INFO 2018-10-12
18:48:47.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit.egg-info/PKG-INFO 2018-10-30
22:23:42.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: prompt-toolkit
-Version: 2.0.6
+Version: 2.0.7
Summary: Library for building powerful interactive command lines in Python
Home-page: https://github.com/jonathanslenders/python-prompt-toolkit
Author: Jonathan Slenders
@@ -12,8 +12,10 @@
|Build Status| |AppVeyor| |PyPI| |RTD| |License|
- ``prompt_toolkit`` is a library for building powerful interactive
command lines
- and terminal applications in Python.
+ .. image ::
https://github.com/prompt-toolkit/python-prompt-toolkit/raw/master/docs/images/logo_400px.png
+
+ *``prompt_toolkit`` is a library for building powerful interactive
command line
+ applications in Python.*
Read the `documentation on readthedocs
<http://python-prompt-toolkit.readthedocs.io/en/stable/>`_.
@@ -30,10 +32,10 @@
Ptpython
********
- `ptpython <http://github.com/jonathanslenders/ptpython/>`_ is an
interactive
+ `ptpython <http://github.com/prompt-toolkit/ptpython/>`_ is an
interactive
Python Shell, build on top of prompt_toolkit.
- .. image ::
https://github.com/jonathanslenders/python-prompt-toolkit/raw/master/docs/images/ptpython.png
+ .. image ::
https://github.com/prompt-toolkit/python-prompt-toolkit/raw/master/docs/images/ptpython.png
prompt_toolkit features
@@ -127,7 +129,7 @@
Shells:
- - `ptpython <http://github.com/jonathanslenders/ptpython/>`_: Python
REPL
+ - `ptpython <http://github.com/prompt-toolkit/ptpython/>`_: Python REPL
- `ptpdb <http://github.com/jonathanslenders/ptpdb/>`_: Python
debugger (pdb replacement)
- `pgcli <http://pgcli.com/>`_: Postgres client.
- `mycli <http://mycli.net>`_: MySql client.
@@ -161,14 +163,14 @@
Full screen applications:
- - `pymux <http://github.com/jonathanslenders/pymux/>`_: A terminal
multiplexer (like tmux) in pure Python.
- - `pyvim <http://github.com/jonathanslenders/pyvim/>`_: A Vim clone in
pure Python.
+ - `pymux <http://github.com/prompt-toolkit/pymux/>`_: A terminal
multiplexer (like tmux) in pure Python.
+ - `pyvim <http://github.com/prompt-toolkit/pyvim/>`_: A Vim clone in
pure Python.
- `freud <http://github.com/stloma/freud/>`_: REST client backed by
SQLite for storing servers
- - `pypager <https://github.com/jonathanslenders/pypager>`_: A $PAGER
in pure Python (like "less").
+ - `pypager <https://github.com/prompt-toolkit/pypager>`_: A $PAGER in
pure Python (like "less").
Libraries:
- - `ptterm <https://github.com/jonathanslenders/ptterm>`_: A terminal
emulator
+ - `ptterm <https://github.com/prompt-toolkit/ptterm>`_: A terminal
emulator
widget for prompt_toolkit.
- `PyInquirer <https://github.com/CITGuru/PyInquirer/>`_: A Python
library that
wants to make it easy for existing Inquirer.js users to write
immersive
@@ -201,21 +203,21 @@
- `Pygments <http://pygments.org/>`_: Syntax highlighter.
- `wcwidth <https://github.com/jquast/wcwidth>`_: Determine columns
needed for a wide characters.
- .. |Build Status| image::
https://api.travis-ci.org/jonathanslenders/python-prompt-toolkit.svg?branch=master
- :target:
https://travis-ci.org/jonathanslenders/python-prompt-toolkit#
+ .. |Build Status| image::
https://api.travis-ci.org/prompt-toolkit/python-prompt-toolkit.svg?branch=master
+ :target:
https://travis-ci.org/prompt-toolkit/python-prompt-toolkit#
.. |PyPI| image:: https://img.shields.io/pypi/v/prompt_toolkit.svg
:target: https://pypi.python.org/pypi/prompt-toolkit/
:alt: Latest Version
.. |AppVeyor| image::
https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva?svg=true
- :target:
https://ci.appveyor.com/project/jonathanslenders/python-prompt-toolkit/
+ :target:
https://ci.appveyor.com/project/prompt-toolkit/python-prompt-toolkit/
.. |RTD| image::
https://readthedocs.org/projects/python-prompt-toolkit/badge/
:target: https://python-prompt-toolkit.readthedocs.io/en/master/
- .. |License| image::
https://img.shields.io/github/license/jonathanslenders/python-prompt-toolkit.svg
- :target:
https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/LICENSE
+ .. |License| image::
https://img.shields.io/github/license/prompt-toolkit/python-prompt-toolkit.svg
+ :target:
https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/LICENSE
Other libraries and implementations in other languages
******************************************************
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/prompt_toolkit.egg-info/SOURCES.txt
new/prompt_toolkit-2.0.7/prompt_toolkit.egg-info/SOURCES.txt
--- old/prompt_toolkit-2.0.6/prompt_toolkit.egg-info/SOURCES.txt
2018-10-12 18:48:47.000000000 +0200
+++ new/prompt_toolkit-2.0.7/prompt_toolkit.egg-info/SOURCES.txt
2018-10-30 22:23:42.000000000 +0100
@@ -31,9 +31,11 @@
examples/full-screen/simple-demos/float-transparency.py
examples/full-screen/simple-demos/floats.py
examples/full-screen/simple-demos/focus.py
+examples/full-screen/simple-demos/horizontal-align.py
examples/full-screen/simple-demos/horizontal-split.py
examples/full-screen/simple-demos/line-prefixes.py
examples/full-screen/simple-demos/margins.py
+examples/full-screen/simple-demos/vertical-align.py
examples/full-screen/simple-demos/vertical-split.py
examples/other/coroutines-and-futures.py
examples/print-text/ansi-colors.py
@@ -41,6 +43,7 @@
examples/print-text/html.py
examples/print-text/named-colors.py
examples/print-text/print-formatted-text.py
+examples/print-text/print-frame.py
examples/print-text/pygments-tokens.py
examples/print-text/true-color-demo.py
examples/progress-bar/a-lot-of-parallel-tasks.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/prompt_toolkit-2.0.6/setup.cfg
new/prompt_toolkit-2.0.7/setup.cfg
--- old/prompt_toolkit-2.0.6/setup.cfg 2018-10-12 18:48:47.000000000 +0200
+++ new/prompt_toolkit-2.0.7/setup.cfg 2018-10-30 22:23:42.000000000 +0100
@@ -15,6 +15,7 @@
E301,
F405,
W503,
+ W504,
E131,
E121,
E227,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/prompt_toolkit-2.0.6/tests/test_formatted_text.py
new/prompt_toolkit-2.0.7/tests/test_formatted_text.py
--- old/prompt_toolkit-2.0.6/tests/test_formatted_text.py 2018-06-02
18:59:41.000000000 +0200
+++ new/prompt_toolkit-2.0.7/tests/test_formatted_text.py 2018-10-30
22:08:05.000000000 +0100
@@ -1,5 +1,5 @@
from __future__ import unicode_literals
-from prompt_toolkit.formatted_text import HTML, ANSI, to_formatted_text,
Template, merge_formatted_text, PygmentsTokens
+from prompt_toolkit.formatted_text import HTML, ANSI, to_formatted_text,
Template, merge_formatted_text, PygmentsTokens, FormattedText
from prompt_toolkit.formatted_text.utils import split_lines
@@ -18,6 +18,12 @@
('', 'after'),
]
+ # It's important that `to_formatted_text` returns a `FormattedText`
+ # instance. Otherwise, `print_formatted_text` won't recognise it and will
+ # print a list literal instead.
+ assert isinstance(to_formatted_text(html), FormattedText)
+
+
def test_html_with_fg_bg():
html = HTML('<style bg="ansired">hello</style>')
assert to_formatted_text(html) == [
@@ -69,6 +75,8 @@
('', 'f'),
]
+ assert isinstance(to_formatted_text(value), FormattedText)
+
def test_interpolation():
value = Template(' {} ').format(HTML('<b>hello</b>'))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/prompt_toolkit-2.0.6/tests/test_print_formatted_text.py
new/prompt_toolkit-2.0.7/tests/test_print_formatted_text.py
--- old/prompt_toolkit-2.0.6/tests/test_print_formatted_text.py 2018-07-22
17:33:30.000000000 +0200
+++ new/prompt_toolkit-2.0.7/tests/test_print_formatted_text.py 2018-10-30
22:08:05.000000000 +0100
@@ -4,7 +4,7 @@
from __future__ import unicode_literals, print_function
import pytest
from prompt_toolkit import print_formatted_text as pt_print
-from prompt_toolkit.formatted_text import FormattedText
+from prompt_toolkit.formatted_text import FormattedText, HTML,
to_formatted_text
from prompt_toolkit.styles import Style
from prompt_toolkit.utils import is_windows
@@ -29,6 +29,11 @@
def isatty(self):
return True
+ def fileno(self):
+ # File descriptor is not used for printing formatted text.
+ # (It is only needed for getting the terminal size.)
+ return -1
+
@pytest.mark.skipif(
is_windows(), reason="Doesn't run on Windows yet.")
@@ -54,3 +59,19 @@
pt_print(tokens, style=style, file=f)
assert b'\x1b[0;38;5;197mHello' in f.data
assert b'\x1b[0;38;5;83;3mworld' in f.data
+
+
[email protected](
+ is_windows(), reason="Doesn't run on Windows yet.")
+def test_with_style():
+ """
+ Text `print_formatted_text` with `HTML` wrapped in `to_formatted_text`.
+ """
+ f = _Capture()
+
+ html = HTML('<ansigreen>hello</ansigreen> <b>world</b>')
+ formatted_text = to_formatted_text(html, style='class:myhtml')
+ pt_print(formatted_text, file=f)
+
+ assert f.data == \
+ b'\x1b[0m\x1b[?7h\x1b[0;32mhello\x1b[0m
\x1b[0;1mworld\x1b[0m\r\n\x1b[0m'