<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/pexpect.git/tests/test_ansi.py, branch interact-logfix</title>
<subtitle>github.com: pexpect/pexpect.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/'/>
<entry>
<title>Merge pull request #99 from takluyver/issue-84</title>
<updated>2014-08-25T07:21:27+00:00</updated>
<author>
<name>Jeff Quast</name>
<email>contact@jeffquast.com</email>
</author>
<published>2014-08-25T07:21:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=9057873f9b73d216149b78c922be19fac8e3a44c'/>
<id>9057873f9b73d216149b78c922be19fac8e3a44c</id>
<content type='text'>
Unicode support for screen and ANSI</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unicode support for screen and ANSI</pre>
</div>
</content>
</entry>
<entry>
<title>Don't define __bytes__(), and don't define __unicode__() on Python 3.</title>
<updated>2014-08-01T07:57:13+00:00</updated>
<author>
<name>David O'Shea</name>
<email>doshea@doshea-centos-x86-64.adl.quantum.com</email>
</author>
<published>2014-08-01T07:40:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=a4b8165da2a7f356e3a12b091727e33e6fcc0d2c'/>
<id>a4b8165da2a7f356e3a12b091727e33e6fcc0d2c</id>
<content type='text'>
The previous attempt to add unicode support tried to make Python 2 and
3 behave in the same way apart from __str__().  This commit makes the
modules, and the tests, provide only __str__() on Python 3 and both
__str__() and __unicode__() on Python 2.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The previous attempt to add unicode support tried to make Python 2 and
3 behave in the same way apart from __str__().  This commit makes the
modules, and the tests, provide only __str__() on Python 3 and both
__str__() and __unicode__() on Python 2.
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename codec and codec_errors to encoding and encoding_errors respectively.</title>
<updated>2014-08-01T07:39:32+00:00</updated>
<author>
<name>David O'Shea</name>
<email>doshea@doshea-centos-x86-64.adl.quantum.com</email>
</author>
<published>2014-08-01T07:39:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=6236c1406d91b5174def54c3a1441391ab29a1c2'/>
<id>6236c1406d91b5174def54c3a1441391ab29a1c2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #84: Unicode support in screen and ANSI.</title>
<updated>2014-07-24T12:39:23+00:00</updated>
<author>
<name>David O'Shea</name>
<email>doshea@doshea-centos-x86-64.adl.quantum.com</email>
</author>
<published>2014-07-08T01:10:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=db34b8fed2c21b8b790d2710fde1004d49c8f00e'/>
<id>db34b8fed2c21b8b790d2710fde1004d49c8f00e</id>
<content type='text'>
This commit updates the the screen and ANSI modules to support Unicode
under Python 2.x.  Under Python 3.x, it was already supported because
strings are Unicode by default.  Now, on both Python versions:

- The constructors accept a codec name (defaults to 'latin-1') and a
  scheme for handling encoding/decoding errors (defaults to
  'replace').  The codec may be set to None to inhibit
  encoding/decoding.

- Unicode is now used internally for storing the screen contents.

- Methods that accept input characters will, if passed input of type
  'bytes' (or, under Python 2.x, 'str'), use the specified codec to
  decode the input, otherwise treating it as Unicode.

- Methods that return screen contents now return Unicode, with the
  exception of __str__() under Python 2.x, and __bytes__() in all
  versions of Python, which return the screen contents encoded using
  the specified codec.

These changes are designed to work only with Python 2.6, 2.7, and 3.3
and later, specifically versions that provide both b'' and u'' string
literals.

The check in ANSI for characters being printable is also removed, as
this prevents non-ASCII characters being accepted, which is not
compatible with the goal of adding Unicode support.  This addresses
issue #83.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit updates the the screen and ANSI modules to support Unicode
under Python 2.x.  Under Python 3.x, it was already supported because
strings are Unicode by default.  Now, on both Python versions:

- The constructors accept a codec name (defaults to 'latin-1') and a
  scheme for handling encoding/decoding errors (defaults to
  'replace').  The codec may be set to None to inhibit
  encoding/decoding.

- Unicode is now used internally for storing the screen contents.

- Methods that accept input characters will, if passed input of type
  'bytes' (or, under Python 2.x, 'str'), use the specified codec to
  decode the input, otherwise treating it as Unicode.

- Methods that return screen contents now return Unicode, with the
  exception of __str__() under Python 2.x, and __bytes__() in all
  versions of Python, which return the screen contents encoded using
  the specified codec.

These changes are designed to work only with Python 2.6, 2.7, and 3.3
and later, specifically versions that provide both b'' and u'' string
literals.

The check in ANSI for characters being printable is also removed, as
this prevents non-ASCII characters being accepted, which is not
compatible with the goal of adding Unicode support.  This addresses
issue #83.
</pre>
</div>
</content>
</entry>
<entry>
<title>Address review comment (no parens around assert statement arguments).</title>
<updated>2014-07-21T23:28:34+00:00</updated>
<author>
<name>David O'Shea</name>
<email>doshea@doshea-centos-x86-64.adl.quantum.com</email>
</author>
<published>2014-07-21T23:28:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=2c18bef6245abe1a5c019e466219e6f0db0eb551'/>
<id>2c18bef6245abe1a5c019e466219e6f0db0eb551</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #85: Don't leave unwanted numbers in ANSI FSM stack/memory.</title>
<updated>2014-07-08T04:56:24+00:00</updated>
<author>
<name>David O'Shea</name>
<email>doshea@doshea-centos-x86-64.adl.quantum.com</email>
</author>
<published>2014-07-08T04:52:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=fbfcfe3a02715c9d54b19c3ea5934b50984071e9'/>
<id>fbfcfe3a02715c9d54b19c3ea5934b50984071e9</id>
<content type='text'>
The FSM transitions set up by ANSI accept a number of escape sequences
that accept one or more numeric parameters where the escape sequence
as a whole is ignored (no action is executed at the end of the
sequence).  This means that the numeric parameters are left on the
FSM's stack, making it harder to improve or subclass ANSI to handle
any of the sequences that take multiple numeric parameters, where it
is necessary to look at the entire stack rather than just, say, pop
one element off the top of the stack.

This fix sets up handlers that discard all items on the stack other
than the bottom-most, which is a reference to the ANSI instance
itself.  The handlers are created as members of ANSI, rather than
methods in the ANSI package, so that they can be overridden in
subclasses without needing to replace FSM transitions.

A unit test is added to verify the new behavior, and the existing
test_number_x() unit test is modified to no longer expect the
parameters to be left on the stack after parsing, and instead use a
subclass of ANSI to capture them.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The FSM transitions set up by ANSI accept a number of escape sequences
that accept one or more numeric parameters where the escape sequence
as a whole is ignored (no action is executed at the end of the
sequence).  This means that the numeric parameters are left on the
FSM's stack, making it harder to improve or subclass ANSI to handle
any of the sequences that take multiple numeric parameters, where it
is necessary to look at the entire stack rather than just, say, pop
one element off the top of the stack.

This fix sets up handlers that discard all items on the stack other
than the bottom-most, which is a reference to the ANSI instance
itself.  The handlers are created as members of ANSI, rather than
methods in the ANSI package, so that they can be overridden in
subclasses without needing to replace FSM transitions.

A unit test is added to verify the new behavior, and the existing
test_number_x() unit test is modified to no longer expect the
parameters to be left on the stack after parsing, and instead use a
subclass of ANSI to capture them.
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #82: Handle more than two numbers in ANSI sequences</title>
<updated>2014-07-03T10:22:30+00:00</updated>
<author>
<name>David O'Shea</name>
<email>doshea@doshea-centos-x86-64.adl.quantum.com</email>
</author>
<published>2014-07-03T10:21:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=8e71465513f1e50433f0ef200ab051fbfd37a375'/>
<id>8e71465513f1e50433f0ef200ab051fbfd37a375</id>
<content type='text'>
FSM transitions were not set up to accept more than one digit in the
third number, or to accept more than three numbers, in ANSI sequences
such as '\x1b[...m'.  They were also not set up to capture the third
and subsequent numbers.  This fix corrects these issues and adds a
unit test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
FSM transitions were not set up to accept more than one digit in the
third number, or to accept more than three numbers, in ANSI sequences
such as '\x1b[...m'.  They were also not set up to capture the third
and subsequent numbers.  This fix corrects these issues and adds a
unit test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add another test for ANSI terminal emulation</title>
<updated>2014-06-05T00:10:53+00:00</updated>
<author>
<name>Thomas Kluyver</name>
<email>takowl@gmail.com</email>
</author>
<published>2014-06-05T00:10:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=9428d05b73098af08fbd3d9ee3cde30a3f122d24'/>
<id>9428d05b73098af08fbd3d9ee3cde30a3f122d24</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix imports in tests for Python 3</title>
<updated>2014-06-02T03:40:07+00:00</updated>
<author>
<name>Thomas Kluyver</name>
<email>takowl@gmail.com</email>
</author>
<published>2014-06-02T00:51:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=8d0e5684a479b93811f8433e672a041f4e0f25d2'/>
<id>8d0e5684a479b93811f8433e672a041f4e0f25d2</id>
<content type='text'>
Closes gh-59
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes gh-59
</pre>
</div>
</content>
</entry>
<entry>
<title>Code tidy-up</title>
<updated>2013-09-25T22:49:54+00:00</updated>
<author>
<name>Thomas Kluyver</name>
<email>takowl@gmail.com</email>
</author>
<published>2013-09-25T22:49:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pexpect.git/commit/?id=8386db8f686394a433f1ea9d1daeee6760a7e664'/>
<id>8386db8f686394a433f1ea9d1daeee6760a7e664</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
