| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
when preceded by any punctuation, not just a sequence of more hyphens.
(That was a special case so Optik and Docutils could wrap long options
like --foo-bar correctly; this change generalizes the special-case.)
Comment fix.
|
| |
|
|
|
| |
wrap() method. Premature optimization is indeed the root of all evil.
Whitespace fix.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
stricter: specifically, "--" must be preceded by a limited set of
characters, not by any non-whitespace character.
|
| | |
|
| | |
|
| |
|
|
|
| |
Rename 'whitespace' global to '_whitespace' -- it's not part of the
public interface.
|
| |
|
|
| |
chars. See the comment for rationale.
|
| |
|
|
| |
efficient. Suggested by MAL.
|
| |
|
|
| |
the input string is always preserved.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
| |
temporary condition).
|
| |
|
|
| |
(rev. 1.4 of distutils/fancy_getopt.py).
|
| |
|
|
| |
enough to fit in one line.
|
| |
|
|
| |
any non-whitespace characters adjacent, not just \w.
|
| |
|
|
|
| |
into /--foo-/bar/ rather than /--/foo-/bar/. Needed for Optik and
Docutils to handle Unix-style command-line options properly.
|
| | |
|
| |
|
|
|
| |
standalone wrap() and fill() functions. This should address the
misunderstanding that led to SF bug 577106.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
keyword args, which are passed directly to the TextWrapper constructor.
|
| |
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Yuck.
|
| |
|
|
|
| |
handle sentences like this:
And she said, "Go to hell!" Can you believe that?
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
according to the conventions that I (and Tim Peters) learned in school.
|