Georg Brandl
47fe9817f1
Merged revisions 67952-67953,67955,67957-67958,67960-67961,67963,67965,67967,67970-67971,67973,67982,67988,67990,67995,68014,68016,68030,68057,68061,68112,68115-68118,68120-68121,68123-68128 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/python/trunk
........
r67952 | georg.brandl | 2008-12-27 18:42:40 +0100 (Sat, 27 Dec 2008) | 2 lines
#4752 : actually use custom handler in example.
........
r67953 | georg.brandl | 2008-12-27 19:20:04 +0100 (Sat, 27 Dec 2008) | 3 lines
Patch #4739 by David Laban: add symbols to pydoc help topics,
so that ``help('@')`` works as expected.
........
r67955 | georg.brandl | 2008-12-27 19:27:53 +0100 (Sat, 27 Dec 2008) | 3 lines
Follow-up to r67746 in order to restore backwards-compatibility for
those who (monkey-)patch TextWrapper.wordsep_re with a custom RE.
........
r67957 | georg.brandl | 2008-12-27 19:49:19 +0100 (Sat, 27 Dec 2008) | 2 lines
#4754 : improve winsound documentation.
........
r67958 | georg.brandl | 2008-12-27 20:02:59 +0100 (Sat, 27 Dec 2008) | 2 lines
#4682 : 'b' is actually unsigned char.
........
r67960 | georg.brandl | 2008-12-27 20:04:44 +0100 (Sat, 27 Dec 2008) | 2 lines
#4695 : fix backslashery.
........
r67961 | georg.brandl | 2008-12-27 20:06:04 +0100 (Sat, 27 Dec 2008) | 2 lines
Use :samp: role.
........
r67963 | georg.brandl | 2008-12-27 20:11:15 +0100 (Sat, 27 Dec 2008) | 2 lines
#4671 : document that pydoc imports modules.
........
r67965 | antoine.pitrou | 2008-12-27 21:34:52 +0100 (Sat, 27 Dec 2008) | 3 lines
Issue #4677 : add two list comprehension tests to pybench.
........
r67967 | benjamin.peterson | 2008-12-27 23:18:58 +0100 (Sat, 27 Dec 2008) | 1 line
fix markup
........
r67970 | alexandre.vassalotti | 2008-12-28 02:52:58 +0100 (Sun, 28 Dec 2008) | 2 lines
Fix name mangling of PyUnicode_ClearFreeList.
........
r67971 | alexandre.vassalotti | 2008-12-28 03:10:35 +0100 (Sun, 28 Dec 2008) | 2 lines
Sort UCS-2/UCS-4 name mangling list.
........
r67973 | alexandre.vassalotti | 2008-12-28 03:58:22 +0100 (Sun, 28 Dec 2008) | 2 lines
Document Py_VaBuildValue.
........
r67982 | benjamin.peterson | 2008-12-28 16:37:31 +0100 (Sun, 28 Dec 2008) | 1 line
fix WORD_BIGEDIAN declaration in Universal builds; fixes #4060 and #4728
........
r67988 | ronald.oussoren | 2008-12-28 20:40:56 +0100 (Sun, 28 Dec 2008) | 1 line
Issue4064: architecture string for universal builds on OSX
........
r67990 | ronald.oussoren | 2008-12-28 20:50:40 +0100 (Sun, 28 Dec 2008) | 3 lines
Update the fix for issue4064 to deal correctly with all three variants of
universal builds that are presented by the configure script.
........
r67995 | benjamin.peterson | 2008-12-28 22:16:07 +0100 (Sun, 28 Dec 2008) | 1 line
#4763 PyErr_ExceptionMatches won't blow up with NULL arguments
........
r68014 | benjamin.peterson | 2008-12-29 18:47:42 +0100 (Mon, 29 Dec 2008) | 1 line
#4764 set IOError.filename when trying to open a directory on POSIX platforms
........
r68016 | benjamin.peterson | 2008-12-29 18:56:58 +0100 (Mon, 29 Dec 2008) | 1 line
#4764 in io.open, set IOError.filename when trying to open a directory on POSIX platforms
........
r68030 | benjamin.peterson | 2008-12-29 22:38:14 +0100 (Mon, 29 Dec 2008) | 1 line
fix French
........
r68057 | vinay.sajip | 2008-12-30 08:01:25 +0100 (Tue, 30 Dec 2008) | 1 line
Minor documentation change relating to NullHandler.
........
r68061 | georg.brandl | 2008-12-30 11:15:49 +0100 (Tue, 30 Dec 2008) | 2 lines
#4778 : attributes can't be called.
........
r68112 | benjamin.peterson | 2009-01-01 00:48:39 +0100 (Thu, 01 Jan 2009) | 1 line
#4795 inspect.isgeneratorfunction() should return False instead of None
........
r68115 | benjamin.peterson | 2009-01-01 05:04:41 +0100 (Thu, 01 Jan 2009) | 1 line
simplfy code
........
r68116 | georg.brandl | 2009-01-01 12:46:51 +0100 (Thu, 01 Jan 2009) | 2 lines
#4100 : note that element children are not necessarily present on "start" events.
........
r68117 | georg.brandl | 2009-01-01 12:53:55 +0100 (Thu, 01 Jan 2009) | 2 lines
#4156 : make clear that "protocol" is to be replaced with the protocol name.
........
r68118 | georg.brandl | 2009-01-01 13:00:19 +0100 (Thu, 01 Jan 2009) | 2 lines
#4185 : clarify escape behavior of replacement strings.
........
r68120 | georg.brandl | 2009-01-01 13:15:31 +0100 (Thu, 01 Jan 2009) | 4 lines
#4228 : Pack negative values the same way as 2.4
in struct's L format.
........
r68121 | georg.brandl | 2009-01-01 13:43:33 +0100 (Thu, 01 Jan 2009) | 2 lines
Point to types module in new module deprecation notice.
........
r68123 | georg.brandl | 2009-01-01 13:52:29 +0100 (Thu, 01 Jan 2009) | 2 lines
#4784 : ... on three counts ...
........
r68124 | georg.brandl | 2009-01-01 13:53:19 +0100 (Thu, 01 Jan 2009) | 2 lines
#4782 : Fix markup error that hid load() and loads().
........
r68125 | georg.brandl | 2009-01-01 14:02:09 +0100 (Thu, 01 Jan 2009) | 2 lines
#4776 : add data_files and package_dir arguments.
........
r68126 | georg.brandl | 2009-01-01 14:05:13 +0100 (Thu, 01 Jan 2009) | 2 lines
Handlers are in the `logging.handlers` module.
........
r68127 | georg.brandl | 2009-01-01 14:14:49 +0100 (Thu, 01 Jan 2009) | 2 lines
#4767 : Use correct submodules for all MIME classes.
........
r68128 | antoine.pitrou | 2009-01-01 15:11:22 +0100 (Thu, 01 Jan 2009) | 3 lines
Issue #3680 : Reference cycles created through a dict, set or deque iterator did not get collected.
........
2009-01-01 15:46:10 +00:00
Benjamin Peterson
c6e80eb5ee
Merged revisions 67654,67676-67677,67681,67692,67725,67746,67748,67761,67784-67785,67787-67788,67802,67832,67848-67849,67859,67862-67864,67880,67882,67885,67889-67892,67895 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/python/trunk
................
r67654 | georg.brandl | 2008-12-07 16:42:09 -0600 (Sun, 07 Dec 2008) | 2 lines
#4457 : rewrite __import__() documentation.
................
r67676 | benjamin.peterson | 2008-12-08 20:03:03 -0600 (Mon, 08 Dec 2008) | 1 line
specify how things are copied
................
r67677 | benjamin.peterson | 2008-12-08 20:05:11 -0600 (Mon, 08 Dec 2008) | 1 line
revert unrelated change to installer script
................
r67681 | jeremy.hylton | 2008-12-09 15:03:10 -0600 (Tue, 09 Dec 2008) | 2 lines
Add simple unittests for Request
................
r67692 | amaury.forgeotdarc | 2008-12-10 18:03:42 -0600 (Wed, 10 Dec 2008) | 2 lines
#1030250 : correctly pass the dry_run option to the mkpath() function.
................
r67725 | benjamin.peterson | 2008-12-12 22:02:20 -0600 (Fri, 12 Dec 2008) | 1 line
fix incorrect example
................
r67746 | antoine.pitrou | 2008-12-13 17:12:30 -0600 (Sat, 13 Dec 2008) | 3 lines
Issue #4163 : Use unicode-friendly word splitting in the textwrap functions when given an unicode string.
................
r67748 | benjamin.peterson | 2008-12-13 19:46:11 -0600 (Sat, 13 Dec 2008) | 1 line
remove has_key usage
................
r67761 | benjamin.peterson | 2008-12-14 11:26:04 -0600 (Sun, 14 Dec 2008) | 1 line
fix missing bracket
................
r67784 | georg.brandl | 2008-12-15 02:33:58 -0600 (Mon, 15 Dec 2008) | 2 lines
#4446 : document "platforms" argument for setup().
................
r67785 | georg.brandl | 2008-12-15 02:36:11 -0600 (Mon, 15 Dec 2008) | 2 lines
#4611 : fix typo.
................
r67787 | georg.brandl | 2008-12-15 02:58:59 -0600 (Mon, 15 Dec 2008) | 2 lines
#4578 : fix has_key() usage in compiler package.
................
r67788 | georg.brandl | 2008-12-15 03:07:39 -0600 (Mon, 15 Dec 2008) | 2 lines
#4568 : remove limitation in varargs callback example.
................
r67802 | amaury.forgeotdarc | 2008-12-15 16:29:14 -0600 (Mon, 15 Dec 2008) | 4 lines
#3632 : the "pyo" macro from gdbinit can now run when the GIL is released.
Patch by haypo.
................
r67832 | antoine.pitrou | 2008-12-17 16:46:54 -0600 (Wed, 17 Dec 2008) | 4 lines
Issue #2467 : gc.DEBUG_STATS reports invalid elapsed times.
Patch by Neil Schemenauer, very slightly modified.
................
r67848 | benjamin.peterson | 2008-12-18 20:28:56 -0600 (Thu, 18 Dec 2008) | 1 line
fix typo
................
r67849 | benjamin.peterson | 2008-12-18 20:31:35 -0600 (Thu, 18 Dec 2008) | 1 line
_call_method -> _callmethod and _get_value to _getvalue
................
r67859 | amaury.forgeotdarc | 2008-12-19 16:56:48 -0600 (Fri, 19 Dec 2008) | 4 lines
#4700 : crtlicense.txt is displayed by the license() command and should be kept ascii-only.
Will port to 3.0
................
r67862 | benjamin.peterson | 2008-12-19 20:48:02 -0600 (Fri, 19 Dec 2008) | 1 line
copy sentence from docstring
................
r67863 | benjamin.peterson | 2008-12-19 20:51:26 -0600 (Fri, 19 Dec 2008) | 1 line
add headings
................
r67864 | benjamin.peterson | 2008-12-19 20:57:19 -0600 (Fri, 19 Dec 2008) | 1 line
beef up docstring
................
r67880 | benjamin.peterson | 2008-12-20 16:49:24 -0600 (Sat, 20 Dec 2008) | 1 line
remove redundant sentence
................
r67882 | benjamin.peterson | 2008-12-20 16:59:49 -0600 (Sat, 20 Dec 2008) | 1 line
add some recent releases to the list
................
r67885 | benjamin.peterson | 2008-12-20 17:48:54 -0600 (Sat, 20 Dec 2008) | 1 line
silence annoying DeprecationWarning
................
r67889 | benjamin.peterson | 2008-12-20 19:04:32 -0600 (Sat, 20 Dec 2008) | 1 line
sphinx.web is long gone
................
r67890 | benjamin.peterson | 2008-12-20 19:12:26 -0600 (Sat, 20 Dec 2008) | 1 line
update readme
................
r67891 | benjamin.peterson | 2008-12-20 19:14:47 -0600 (Sat, 20 Dec 2008) | 1 line
there are way too many places which need to have the current version added
................
r67892 | benjamin.peterson | 2008-12-20 19:29:32 -0600 (Sat, 20 Dec 2008) | 9 lines
Merged revisions 67809 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r67809 | benjamin.peterson | 2008-12-15 21:54:45 -0600 (Mon, 15 Dec 2008) | 1 line
fix logic error
........
................
r67895 | neal.norwitz | 2008-12-21 08:28:32 -0600 (Sun, 21 Dec 2008) | 2 lines
Add Tarek for work on distutils.
................
2008-12-21 17:01:26 +00:00
Georg Brandl
f3a0b86408
Merged revisions 67571,67574-67576,67579-67581,67583,67591,67597,67608,67631 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/python/trunk
........
r67571 | georg.brandl | 2008-12-05 10:13:45 +0100 (Fri, 05 Dec 2008) | 2 lines
Use markup.
........
r67574 | georg.brandl | 2008-12-05 10:25:32 +0100 (Fri, 05 Dec 2008) | 2 lines
#4441 followup: Add link to open() docs for Windows.
........
r67575 | georg.brandl | 2008-12-05 12:34:51 +0100 (Fri, 05 Dec 2008) | 2 lines
#4544 : add `dedent` to textwrap.__all__.
........
r67576 | georg.brandl | 2008-12-05 13:09:41 +0100 (Fri, 05 Dec 2008) | 2 lines
#4529 : fix parser's validation for try-except-finally statements.
........
r67579 | georg.brandl | 2008-12-05 16:29:39 +0100 (Fri, 05 Dec 2008) | 2 lines
#4517 : add "special method" glossary entry and clarify when __getattribute__ is bypassed.
........
r67580 | georg.brandl | 2008-12-05 16:32:29 +0100 (Fri, 05 Dec 2008) | 2 lines
#4478 : document that copyfile() can raise Error.
........
r67581 | georg.brandl | 2008-12-05 16:42:03 +0100 (Fri, 05 Dec 2008) | 2 lines
#3171 : document that *slice are removed in 3k.
........
r67583 | georg.brandl | 2008-12-05 16:52:20 +0100 (Fri, 05 Dec 2008) | 4 lines
Move __import__ to the bottom of the functions list.
It doesn't make sense for such a fundamental document to have
the most obscure function listed at the top.
........
r67591 | georg.brandl | 2008-12-05 19:00:06 +0100 (Fri, 05 Dec 2008) | 2 lines
Followup to #4511 : add link from decorator glossary entry to definition.
........
r67597 | georg.brandl | 2008-12-05 20:03:19 +0100 (Fri, 05 Dec 2008) | 2 lines
Remove confusing sentence part.
........
r67608 | georg.brandl | 2008-12-06 12:57:12 +0100 (Sat, 06 Dec 2008) | 2 lines
Follow-up to #4488 : document PIPE and STDOUT properly.
........
r67631 | georg.brandl | 2008-12-07 12:54:07 +0100 (Sun, 07 Dec 2008) | 2 lines
Add link to the favicon to the docs.
........
2008-12-07 14:47:12 +00:00
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
Greg Ward
ab73d46e45
Fix SF bug #622849 : in _wrap_chunks(), ensure that leading whitespace in
...
the input string is always preserved.
2002-12-09 16:26:05 +00:00
Greg Ward
2e74541d7e
Fix SF bug #622831 (I think): add unicode_whitespace_trans class
...
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.
2002-12-09 16:23:08 +00:00
Greg Ward
4c486bc0c0
Add comment about inability to handle Unicode strings (hopefully a
...
temporary condition).
2002-10-22 18:31:50 +00:00
Greg Ward
78cc051617
Fix copyright date: the core of this code actually dates back to 1999
...
(rev. 1.4 of distutils/fancy_getopt.py).
2002-10-13 19:23:18 +00:00
Guido van Rossum
eb287a2662
Fix an endcase bug: initial_indent was ignored when the text was short
...
enough to fit in one line.
2002-10-02 15:47:32 +00:00
Greg Ward
e3bd104aa7
Tweak wordsep_re again: this time to recognize an em-dash with
...
any non-whitespace characters adjacent, not just \w.
2002-08-22 21:28:00 +00:00
Greg Ward
cce4d67fc4
Fix SF bug #596434 : tweak wordsep_re so "--foo-bar" now splits
...
into /--foo-/bar/ rather than /--/foo-/bar/. Needed for Optik and
Docutils to handle Unix-style command-line options properly.
2002-08-22 21:04:21 +00:00
Tim Peters
c411dbaeee
Whitespace normalization.
2002-07-16 21:35:23 +00:00
Greg Ward
e807e571a1
Docstring improvements. In particular, added docstrings for the
...
standalone wrap() and fill() functions. This should address the
misunderstanding that led to SF bug 577106.
2002-07-04 14:51:49 +00:00
Greg Ward
62080bee14
Took initial_tab and subsequent_tab away from the fill() method and
...
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.
2002-06-10 21:37:12 +00:00
Greg Ward
cf02ac6154
Allow the standalone wrap() and fill() functions to take arbitrary
...
keyword args, which are passed directly to the TextWrapper constructor.
2002-06-10 20:36:07 +00:00
Greg Ward
d34c959140
Make 'width' an instance attribute rather than an argument to the wrap()
...
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.
2002-06-10 20:26:02 +00:00
Greg Ward
47df99d575
Make all of TextWrapper's options keyword args to the constructor.
2002-06-09 00:22:07 +00:00
Greg Ward
698d9f01c6
Record copyright and author.
2002-06-07 22:40:23 +00:00
Greg Ward
70c726aa44
Use True/False instead of 1/0.
2002-06-07 22:35:41 +00:00
Greg Ward
f404c7ee84
Remove islower() -- not used anymore.
2002-06-07 22:33:11 +00:00
Greg Ward
cb320eb938
Conform to the bloody coding standards: "def foo()" not "def foo ()".
...
Yuck.
2002-06-07 22:32:15 +00:00
Greg Ward
9b4864e40a
Convert _fix_sentence_endings() to use a regex, and augment it to
...
handle sentences like this:
And she said, "Go to hell!" Can you believe that?
2002-06-07 22:04:15 +00:00
Greg Ward
62e4f3bf22
Add fix_sentence_endings option to control whether we ensure 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.
2002-06-07 21:56:16 +00:00
Greg Ward
0093582489
Initial revision. Currently biased towards English in a fixed-width font,
...
according to the conventions that I (and Tim Peters) learned in school.
2002-06-07 21:43:37 +00:00