[issue12485] Improvement of textwrap module

2011-07-03 Thread Tyler Romeo
New submission from Tyler Romeo : Python's textwrap module can be helpful at times, but personally I think there are a couple of things that could be added. First, when it comes to text wrapping, usually you're not dealing with a monospace font where each letter is the same size.

[issue12485] textwrap.wrap: add control for custom length and orphans

2011-07-04 Thread Tyler Romeo
Tyler Romeo added the comment: Nah, they're both unrelated. I'll separate the changes and remake the patches. (I'll keep this entry for the beautification part.) -- ___ Python tracker <http://bugs.pyt

[issue12485] textwrap.wrap: add control for custom length and orphans

2011-07-04 Thread Tyler Romeo
Tyler Romeo added the comment: OK, so here is the patch for just the new algorithm. -- Added file: http://bugs.python.org/file22573/textwrap.py-new-algorithm-2011-07-04_22-45-53_r71219+.diff ___ Python tracker <http://bugs.python.org/issue12

[issue12499] textwrap.wrap: add control for fonts with different character widths

2011-07-04 Thread Tyler Romeo
New submission from Tyler Romeo : Originally from http://bugs.python.org/issue12485 but separated. The textwrap modules uses len to determine the length of text, but in many (if not most) fonts, the width of a character differs depending on the letter, so it would be useful to have an option

[issue12485] textwrap.wrap: add control for custom length and orphans

2011-07-04 Thread Tyler Romeo
Changes by Tyler Romeo : Removed file: http://bugs.python.org/file22561/textwrap.py-improvement.diff ___ Python tracker <http://bugs.python.org/issue12485> ___ ___ Pytho

[issue12499] textwrap.wrap: add control for fonts with different character widths

2011-07-05 Thread Tyler Romeo
Tyler Romeo added the comment: Normally I would have just added it as a function to be overloaded, but because of the nature of the textwrap.wrap function (all kwargs are passed to the TextWrapper constructor) I thought it made a lot more sense to keep it as an argument to __init__

[issue12485] textwrap.wrap: new argument for more pleasing output

2011-07-11 Thread Tyler Romeo
Tyler Romeo added the comment: OK, sorry to get back so late, but here's the updated patch without xrange. I saw the version change but forgot that I used xrange in the function (old habits I guess). -- Added file: http://bugs.python.org/file22626/textwrap.py-beautiful-2011-07-

[issue12485] textwrap.wrap: new argument for more pleasing output

2011-07-11 Thread Tyler Romeo
Changes by Tyler Romeo : Removed file: http://bugs.python.org/file22573/textwrap.py-new-algorithm-2011-07-04_22-45-53_r71219+.diff ___ Python tracker <http://bugs.python.org/issue12