Brett Cannon
791ec1fc13
Remove assignment to True/False to silence the SyntaxWarning that is triggered
...
by -3.
2008-08-01 01:34:05 +00:00
Georg Brandl
6f95ae55b1
#2659 : add `break_on_hyphens` to TextWrapper.
2008-05-11 10:42:28 +00:00
Mark Dickinson
fe536f53ea
Issue 2635: fix bug in the fix_sentence_endings option to textwrap.fill.
2008-04-25 16:59:09 +00:00
Georg Brandl
c6fde7293e
Fix #1146 : TextWrap vs words 1-character shorter than the width.
...
Patch by Quentin Gallet-Gilles.
2008-01-19 19:48:19 +00:00
Georg Brandl
9e6b47002a
Patch #1581073 : add a flag to textwrap that prevents the dropping of
...
whitespace while wrapping.
2007-03-13 18:15:41 +00:00
Tim Peters
4f96f1f2b5
Whitespace normalization.
2006-06-11 19:42:51 +00:00
Greg Ward
7f54740c4d
Bug #1361643 : fix textwrap.dedent() so it handles tabs appropriately,
...
i.e. do *not* expand tabs, but treat them as whitespace that is not
equivalent to spaces. Add a couple of test cases. Clarify docs.
2006-06-11 00:40:49 +00:00
Raymond Hettinger
8bfa8935ea
textwrap now processes text chucks at O(n) speed instead of O(n**2).
...
Patch #1209527 (Contributed by Connelly).
2005-07-15 06:53:35 +00:00
Greg Ward
40407943b7
SF #1149508 : ensure textwrap handles hyphenated numbers correctly,
...
eg. "2004-03-04" is not broken across lines. (Merged from 2.4 branch.)
2005-03-05 02:53:17 +00:00
Raymond Hettinger
0c26ab02e6
Removed unused line.
2005-01-03 07:14:12 +00:00
Greg Ward
6186410db0
SF #965425 : fix so hyphenated words surrounded by punctuation are
...
wrapped correctly.
2004-06-03 01:59:41 +00:00
Greg Ward
f0ba764dbb
SF #847346 : merge from release23-maint branch: remove misguided
...
optimization for short input; beef up tests for fix_sentence_endings
feature.
2004-05-13 01:53:10 +00:00
Raymond Hettinger
c11dbcd4bf
SF bug 797650: Infinite loop in textwrap.py
...
When the indents were set to longer than the width and long word breaking
was enabled, an infinite loop would result because the inner loop did not
assure that at least one character was stripped off on every pass.
2003-08-30 14:43:55 +00:00
Greg Ward
523008c6cf
Update copyright dates.
...
Define True and False (if necessary) so this module can be copied as-is
to other projects (eg. Optik, Docutils) that don't depend on Python 2.3.
2003-06-15 15:37:18 +00:00
Greg Ward
52ae0a596f
Remove comment about Unicode: SF #622831 was fixed loooong ago!
2003-06-14 00:26:39 +00:00
Tim Peters
c2659cff5d
Whitespace normalization.
2003-05-12 20:19:37 +00:00
Greg Ward
86e1790cad
Clarify the dedent() example a bit by indenting the input lines unevenly.
2003-05-08 02:12:35 +00:00
Greg Ward
2557100b9e
Minor clarification of dedent().
2003-05-08 02:02:50 +00:00
Greg Ward
478cd48dee
SF patch #598163 (Ville Vainio, vvainio@users.sourceforge.net):
...
add dedent() function, to remove indentation from multiline strings
(eg. triple-quoted strings). Differs from inspect.getdoc() by not
special-casing the first line (often a sensible approach for
non-docstring multiline strings). This should make this function more
general (symmetric 'indent' also possible), and more fitting for the
textwrap module.
2003-05-08 01:58:05 +00:00
Greg Ward
a409f7c491
SF #596434 : tweak wordsep_re so the definition of an em-dash is
...
stricter: specifically, "--" must be preceded by a limited set of
characters, not by any non-whitespace character.
2003-05-07 01:20:58 +00:00
Greg Ward
21820cd925
SF #726446 : raise ValueError if width <= 0.
2003-05-07 00:55:35 +00:00
Andrew M. Kuchling
a2ecabe420
Fix docstring typo
2003-02-14 01:14:15 +00:00
Greg Ward
4c6c9c42fb
Add __all__ (suggested by Raymond Hettinger).
...
Rename 'whitespace' global to '_whitespace' -- it's not part of the
public interface.
2003-02-03 14:46:57 +00:00
Greg Ward
afd44de812
Hardcode the recognized whitespace characters to the US-ASCII whitespace
...
chars. See the comment for rationale.
2002-12-12 17:24:35 +00:00
Greg Ward
0e88c9f65d
Tweak generation of unicode_whitespace_trans -- clearer, more
...
efficient. Suggested by MAL.
2002-12-11 13:54:20 +00:00