summaryrefslogtreecommitdiffstats
path: root/Lib/textwrap.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix docstring typoAndrew M. Kuchling2003-02-141-1/+1
|
* Add __all__ (suggested by Raymond Hettinger).Greg Ward2003-02-031-3/+5
| | | | | Rename 'whitespace' global to '_whitespace' -- it's not part of the public interface.
* Hardcode the recognized whitespace characters to the US-ASCII whitespaceGreg Ward2002-12-121-3/+12
| | | | chars. See the comment for rationale.
* Tweak generation of unicode_whitespace_trans -- clearer, moreGreg Ward2002-12-111-2/+3
| | | | efficient. Suggested by MAL.
* Fix SF bug #622849: in _wrap_chunks(), ensure that leading whitespace inGreg Ward2002-12-091-2/+3
| | | | the input string is always preserved.
* Fix SF bug #622831 (I think): add unicode_whitespace_trans classGreg Ward2002-12-091-1/+8
| | | | | | attribute, and modify _munge_whitespace() to recognize Unicode strings and use unicode_whitespace_trans to munge them. Still need to add a test to make sure I've really fixed the bug.
* Add comment about inability to handle Unicode strings (hopefully aGreg Ward2002-10-221-0/+3
| | | | temporary condition).
* Fix copyright date: the core of this code actually dates back to 1999Greg Ward2002-10-131-2/+2
| | | | (rev. 1.4 of distutils/fancy_getopt.py).
* Fix an endcase bug: initial_indent was ignored when the text was shortGuido van Rossum2002-10-021-2/+3
| | | | enough to fit in one line.
* Tweak wordsep_re again: this time to recognize an em-dash withGreg Ward2002-08-221-1/+1
| | | | any non-whitespace characters adjacent, not just \w.
* Fix SF bug #596434: tweak wordsep_re so "--foo-bar" now splitsGreg Ward2002-08-221-1/+1
| | | | | into /--foo-/bar/ rather than /--/foo-/bar/. Needed for Optik and Docutils to handle Unix-style command-line options properly.
* Whitespace normalization.Tim Peters2002-07-161-3/+3
|
* Docstring improvements. In particular, added docstrings for theGreg Ward2002-07-041-10/+27
| | | | | standalone wrap() and fill() functions. This should address the misunderstanding that led to SF bug 577106.
* Took initial_tab and subsequent_tab away from the fill() method andGreg Ward2002-06-101-22/+34
| | | | | | | | transformed them into the initial_indent and subsequent_indent instance attributes. Now they actually work as advertised, ie. they are accounted for in the width of each output line. Plus you can use them with wrap() as well as fill(), and fill() went from simple-and-broken to trivial-and-working.
* Allow the standalone wrap() and fill() functions to take arbitraryGreg Ward2002-06-101-4/+6
| | | | keyword args, which are passed directly to the TextWrapper constructor.
* Make 'width' an instance attribute rather than an argument to the wrap()Greg Ward2002-06-101-31/+32
| | | | | | | and fill() methods. Keep interface of existing wrap() and fill() functions by going back to having them construct a new TextWrapper instance on each call, with the preferred width passed to the constructor.
* Make all of TextWrapper's options keyword args to the constructor.Greg Ward2002-06-091-5/+9
|
* Record copyright and author.Greg Ward2002-06-071-0/+4
|
* Use True/False instead of 1/0.Greg Ward2002-06-071-5/+5
|
* Remove islower() -- not used anymore.Greg Ward2002-06-071-6/+0
|
* Conform to the bloody coding standards: "def foo()" not "def foo ()".Greg Ward2002-06-071-10/+10
| | | | Yuck.
* Convert _fix_sentence_endings() to use a regex, and augment it toGreg Ward2002-06-071-8/+8
| | | | | handle sentences like this: And she said, "Go to hell!" Can you believe that?
* Add fix_sentence_endings option to control whether we ensure thatGreg Ward2002-06-071-16/+25
| | | | | | | | sentences are separated by two spaces. Improve _fix_sentence_endings() a bit -- look for ".!?" instead of just ".", and factor out the list of sentence-ending punctuation characters to a class attribute.
* Initial revision. Currently biased towards English in a fixed-width font,Greg Ward2002-06-071-0/+239
according to the conventions that I (and Tim Peters) learned in school.