[Python-modules-commits] [python-blessed] 01/07: Import python-blessed_1.14.2.orig.tar.gz
Pierre-Elliott Bécue
peb-guest at moszumanska.debian.org
Sun Dec 31 13:02:04 UTC 2017
This is an automated email from the git hooks/post-receive script.
peb-guest pushed a commit to branch master
in repository python-blessed.
commit 9cf4b2b68909af9ef45a3cc7689f9f3995b0aefa
Author: Pierre-Elliott Bécue <becue at crans.org>
Date: Sun Dec 31 13:57:22 2017 +0100
Import python-blessed_1.14.2.orig.tar.gz
---
PKG-INFO | 2 +-
blessed.egg-info/PKG-INFO | 2 +-
blessed/__init__.py | 1 +
blessed/_capabilities.py | 4 ++++
blessed/terminal.py | 31 ++++++++++++++++++-------------
blessed/tests/test_formatters.py | 4 ++--
docs/contributing.rst | 3 +--
docs/history.rst | 4 ++++
docs/overview.rst | 28 +++++++++++++++++++++-------
setup.cfg | 2 +-
version.json | 2 +-
11 files changed, 55 insertions(+), 28 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index 1853883..897de2e 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: blessed
-Version: 1.14.1
+Version: 1.14.2
Summary: A thin, practical wrapper around terminal styling, screen positioning, and keyboard input.
Home-page: https://github.com/jquast/blessed
Author: Jeff Quast, Erik Rose
diff --git a/blessed.egg-info/PKG-INFO b/blessed.egg-info/PKG-INFO
index 1853883..897de2e 100644
--- a/blessed.egg-info/PKG-INFO
+++ b/blessed.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: blessed
-Version: 1.14.1
+Version: 1.14.2
Summary: A thin, practical wrapper around terminal styling, screen positioning, and keyboard input.
Home-page: https://github.com/jquast/blessed
Author: Jeff Quast, Erik Rose
diff --git a/blessed/__init__.py b/blessed/__init__.py
index 88954e1..cf5fbb9 100644
--- a/blessed/__init__.py
+++ b/blessed/__init__.py
@@ -16,3 +16,4 @@ if ('3', '0', '0') <= _platform.python_version_tuple() < ('3', '2', '2+'):
'support due to http://bugs.python.org/issue10570.')
__all__ = ('Terminal',)
+__version__ = '1.14.2'
diff --git a/blessed/_capabilities.py b/blessed/_capabilities.py
index a4c6d05..c6f96c9 100644
--- a/blessed/_capabilities.py
+++ b/blessed/_capabilities.py
@@ -142,6 +142,10 @@ CAPABILITIES_ADDITIVES = {
'sgr0': ('sgr0', re.escape('\x1b') + r'\[m'),
'backspace': ('', re.escape('\b')),
'ascii_tab': ('', re.escape('\t')),
+ 'clr_eol': ('', re.escape('\x1b[K')),
+ 'clr_eol0': ('', re.escape('\x1b[0K')),
+ 'clr_bol': ('', re.escape('\x1b[1K')),
+ 'clr_eosK': ('', re.escape('\x1b[2K')),
}
CAPABILITIES_CAUSE_MOVEMENT = (
diff --git a/blessed/terminal.py b/blessed/terminal.py
index 1cda21a..fc9c8af 100644
--- a/blessed/terminal.py
+++ b/blessed/terminal.py
@@ -222,9 +222,8 @@ class Terminal(object):
' returned for the remainder of this process.' % (
self._kind, _CUR_TERM,))
- # initialize capabilities database
+ # initialize capabilities and terminal keycodes database
self.__init__capabilities()
-
self.__init__keycodes()
def __init__capabilities(self):
@@ -274,17 +273,24 @@ class Terminal(object):
# Build database of sequence <=> KEY_NAME.
self._keymap = get_keyboard_sequences(self)
+
# build set of prefixes of sequences
self._keymap_prefixes = get_leading_prefixes(self._keymap)
+ # keyboard stream buffer
self._keyboard_buf = collections.deque()
+
if self._keyboard_fd is not None:
+ # set input encoding and initialize incremental decoder
locale.setlocale(locale.LC_ALL, '')
self._encoding = locale.getpreferredencoding() or 'ascii'
+
try:
self._keyboard_decoder = codecs.getincrementaldecoder(
self._encoding)()
+
except LookupError as err:
+ # encoding is illegal or unsupported, use 'ascii'
warnings.warn('LookupError: {0}, fallback to ASCII for '
'keyboard.'.format(err))
self._encoding = 'ascii'
@@ -1002,21 +1008,20 @@ class Terminal(object):
r"""
A context manager for :func:`tty.setraw`.
- Raw mode differs from :meth:`cbreak` mode in that input and output
- processing of characters is disabled, in similar in that they both
- allow each keystroke to be read immediately after it is pressed.
+ Although both :meth:`break` and :meth:`raw` modes allow each keystroke
+ to be read immediately after it is pressed, Raw mode disables processing
+ of input and output.
- For input, the interrupt, quit, suspend, and flow control characters
- are received as their raw control character values rather than
- generating a signal.
+ In cbreak mode, special input characters such as ``^C`` or ``^S`` are
+ interpreted by the terminal driver and excluded from the stdin stream.
+ In raw mode these values are receive by the :meth:`inkey` method.
- For output, the newline ``chr(10)`` is not sufficient enough to return
- the carriage, requiring ``chr(13)`` printed explicitly by your
- program::
+ Because output processing is not done, the newline ``'\n'`` is not
+ enough, you must also print carriage return to ensure that the cursor
+ is returned to the first column::
with term.raw():
- print("printing in raw mode", end="\r\n")
-
+ print("printing in raw mode", end="\r\n")
"""
if HAS_TTY and self._keyboard_fd is not None:
# Save current terminal mode:
diff --git a/blessed/tests/test_formatters.py b/blessed/tests/test_formatters.py
index 01762d3..660e920 100644
--- a/blessed/tests/test_formatters.py
+++ b/blessed/tests/test_formatters.py
@@ -382,7 +382,7 @@ def test_pickled_parameterizing_string(monkeypatch):
for proto_num in range(pickle.HIGHEST_PROTOCOL):
assert pstr == pickle.loads(pickle.dumps(pstr, protocol=proto_num))
w.send(pstr)
- r.recv() == pstr
+ assert r.recv() == pstr
# exercise picklability of FormattingString
# -- the return value of calling ParameterizingString
@@ -390,7 +390,7 @@ def test_pickled_parameterizing_string(monkeypatch):
for proto_num in range(pickle.HIGHEST_PROTOCOL):
assert zero == pickle.loads(pickle.dumps(zero, protocol=proto_num))
w.send(zero)
- r.recv() == zero
+ assert r.recv() == zero
def test_tparm_returns_null(monkeypatch):
diff --git a/docs/contributing.rst b/docs/contributing.rst
index fd54bd7..5aa648c 100644
--- a/docs/contributing.rst
+++ b/docs/contributing.rst
@@ -15,8 +15,7 @@ Prepare a developer environment. Then, from the blessed code folder::
pip install --editable .
Any changes made in this project folder are then made available to the python
-interpreter as the 'blessed' package regardless of the current working
-directory.
+interpreter as the 'blessed' package from any working directory.
Running Tests
~~~~~~~~~~~~~
diff --git a/docs/history.rst b/docs/history.rst
index 0cf34d3..e593377 100644
--- a/docs/history.rst
+++ b/docs/history.rst
@@ -5,6 +5,10 @@ Version History
:ghissue:`74`.
* bugfix: TypeError when using ``PYTHONOPTIMIZE=2`` environment variable,
:ghissue:`84`.
+ * bugfix: define ``blessed.__version__`` value,
+ :ghissue:`92`.
+ * bugfix: detect sequences ``\x1b[0K`` and ``\x1b2K``,
+ :ghissue:`95`.
1.13
* enhancement: :meth:`~.Terminal.split_seqs` introduced, and 4x cost
diff --git a/docs/overview.rst b/docs/overview.rst
index b319294..4a87660 100644
--- a/docs/overview.rst
+++ b/docs/overview.rst
@@ -278,12 +278,12 @@ this::
term = Terminal()
print(term.move(10, 1) + 'Hi, mom!')
-``move``
- Position the cursor, parameter in form of *(y, x)*
-``move_x``
- Position the cursor at given horizontal column.
-``move_y``
- Position the cursor at given vertical column.
+``move(y, x)``
+ Position cursor at given **y**, **x**.
+``move_x(x)``
+ Position cursor at column **x**.
+``move_y(y)``
+ Position cursor at row **y**.
One-Notch Movement
~~~~~~~~~~~~~~~~~~
@@ -490,7 +490,21 @@ The mode entered using :meth:`~.Terminal.cbreak` is called
character-processing (interrupt and flow control characters are unaffected),
making characters typed by the user immediately available to the program.
-:meth:`~.Terminal.raw` is similar to cbreak, but not recommended.
+raw
+~~~
+
+:meth:`~.Terminal.raw` is similar to cbreak, except that control-C and
+other keystrokes are "ignored", and received as their keystroke value
+rather than interrupting the program with signals.
+
+Output processing is also disabled, you must print phrases with carriage
+return after newline. Without raw mode::
+
+ print("hello, world.")
+
+With raw mode::
+
+ print("hello, world.", endl="\r\n")
inkey
~~~~~
diff --git a/setup.cfg b/setup.cfg
index 7633f81..6f08d0e 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -2,7 +2,7 @@
universal = 1
[egg_info]
+tag_build =
tag_date = 0
tag_svn_revision = 0
-tag_build =
diff --git a/version.json b/version.json
index 5867d71..00a1292 100644
--- a/version.json
+++ b/version.json
@@ -1 +1 @@
-{"version": "1.14.1"}
+{"version": "1.14.2"}
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-blessed.git
More information about the Python-modules-commits
mailing list