Morgan243 / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
0 stars 0 forks source link

Fix 2 issues in ipm #175

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Issue 1:
If the string to print contains an embedded REPLY_TERMINATOR, "\x04", the print 
stream becomes disrupted:

ipm> print "test\x04this"
testipm> print "hello"
this

Issue 2:
When an interactive statement does not return immediately, the ipm-host does 
not print anything until the VM completes execution and sends the 
REPLY_TERMINATOR.  Example:

ipm> for i in range(10):
....   print i
....   sys.wait(2000)
.... 
<20 second wait here, the user sees nothing>
0
1
2
3
4
5
6
7
8
9
<the user sees 0..9 printed in one big dump>

Original issue reported on code.google.com by dwhall...@gmail.com on 19 Dec 2010 at 1:12

GoogleCodeExporter commented 8 years ago
Modified src/vm/strobj.c to print an escape character (0x1B) before a 
REPLY_TERMINATOR and an escape character.
Modified src/tools/ipm.py to yield and print each character as it arrives 
(rather than collecting and holding it until the REPLY_TERMINATOR arrives).

Original comment by dwhall...@gmail.com on 19 Dec 2010 at 3:05

GoogleCodeExporter commented 8 years ago
Tested using ipm on desktop.  Did NOT test the serial connection.

r100b4f3847a2 mainlined directly.

Original comment by dwhall...@gmail.com on 19 Dec 2010 at 3:13