[issue6733] curses line wrap broken when mixing full- and half-width unicode characters

2015-04-14 Thread Chris Abiad

Chris Abiad added the comment:

The original problem was described as:
"the character is printed at the start of the current line rather than the 
start of the next line."

I haven't gotten too far investigating the cause, but adding a single line to 
the sample code makes this test code a bit easier to use. Without a pause at 
the end of execution, my terminal immediately clears the screen making it 
impossible to see the output.

#! /usr/bin/python
import locale
locale.setlocale(locale.LC_ALL, '')
code = locale.getpreferredencoding()
import curses
def main(stdscr):
stdscr.erase()
stdscr.move(0, 0)
for i in range(0,stdscr.getmaxyx()[1] - 1):
stdscr.addstr(".");
stdscr.addstr(u"\u3007\u3007".encode(code));
stdscr.refresh()
c = stdscr.getch()  # the new line
curses.wrapper(main)

Tested and reproduced on the following platforms:
1.
* XTerm(309) (NOTE: You must run `export LC_ALL=en_US.UTF-8` before non-ascii 
encodings will work at all in xterm)
* XQuartz 2.7.7
* Mac OS X 10.10.1

2.
* iTerm2 1.0.0.20130622
* Mac OS X 10.10.1

With each of the following python versions:
* 2.7.9
* 3.4.3
* Latest 'default' branch

--
nosy: +cabiad

___
Python tracker 
<http://bugs.python.org/issue6733>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14117] Turtledemo: exception and minor glitches.

2015-04-14 Thread Chris Abiad

Chris Abiad added the comment:

Running through each of the demos, it seems as though only 'penrose' and 'tree' 
have console/shell output.

'penrose' output is a list of information about the current rendering and has a 
format like:
Calculation:0.0009 s
Drawing:   0.0074 s
Together:  0.0083 s
5 kites and 0 darts = 5 pieces.
(... This repeats with updated information for each rendering ...)

I believe that there's too much output right now to include this in the demo 
window's message button area. It might be interesting to show most or all of 
this information with a turtle.write() in the graphical area, but I think that 
the better option is just to remove (or at least comment out) the timing 
information entirely and show only the '5 kites and 0 darts = 5 pieces' portion 
in the message button area.

I could submit a patch for either 'penrose' option if there's interest.

The 'tree' prints a count of the number of turtles created at the end of the 
run. Console output looks like:
1024

I think this is not very useful, except perhaps when debugging the demo. I've 
attached a patch which removes this output.

--
keywords: +patch
nosy: +cabiad
Added file: http://bugs.python.org/file38986/14117_tree_output.patch

___
Python tracker 
<http://bugs.python.org/issue14117>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com