diff --recursive -u ../original/trunk/Doc/distutils/setupscript.rst Doc/distutils/setupscript.rst --- ../original/trunk/Doc/distutils/setupscript.rst 2008-02-11 11:59:09.452859500 +0100 +++ Doc/distutils/setupscript.rst 2008-02-21 13:41:02.983574200 +0100 @@ -185,7 +185,7 @@ same base package), use the :option:`ext_package` keyword argument to :func:`setup`. For example, :: - setup(... + setup(..., ext_package='pkg', ext_modules=[Extension('foo', ['foo.c']), Extension('subpkg.bar', ['bar.c'])], @@ -214,7 +214,7 @@ This warning notwithstanding, options to SWIG can be currently passed like this:: - setup(... + setup(..., ext_modules=[Extension('_foo', ['foo.i'], swig_opts=['-modern', '-I../include'])], py_modules=['foo'], @@ -443,7 +443,7 @@ The :option:`scripts` option simply is a list of files to be handled in this way. From the PyXML setup script:: - setup(... + setup(..., scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'] ) @@ -501,7 +501,7 @@ :option:`data_files` specifies a sequence of (*directory*, *files*) pairs in the following way:: - setup(... + setup(..., data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']), ('config', ['cfg/data.cfg']), ('/etc/init.d', ['init-script'])] @@ -613,7 +613,7 @@ :option:`classifiers` are specified in a python list:: - setup(... + setup(..., classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', diff --recursive -u ../original/trunk/Doc/library/optparse.rst Doc/library/optparse.rst --- ../original/trunk/Doc/library/optparse.rst 2008-02-11 11:59:13.060548200 +0100 +++ Doc/library/optparse.rst 2008-02-21 14:44:23.117375700 +0100 @@ -1633,7 +1633,7 @@ value.append(arg) del rargs[0] - setattr(parser.values, option.dest, value) + setattr(parser.values, option.dest, value) [...] parser.add_option("-c", "--callback", diff --recursive -u ../original/trunk/Doc/tools/sphinx/highlighting.py Doc/tools/sphinx/highlighting.py --- ../original/trunk/Doc/tools/sphinx/highlighting.py 2008-02-21 14:46:02.860744800 +0100 +++ Doc/tools/sphinx/highlighting.py 2008-02-21 14:45:04.039334500 +0100 @@ -70,13 +70,23 @@ lexer = lexers['pycon'] else: # maybe Python -- try parsing it + src = source + '\n' + + # Replace "..." by a special mark, + # which is also a valid python expression + mark = "__highlighting__ellipsis__" + src = src.replace("...", mark) + + # lines beginning with "..." are probably placeholders for suite + import re + src = re.sub(r"(?m)^(\s*)" + mark + "(.)", r"\1"+ mark + r"# \2", src) + + # if we're using 2.5, use the with statement + if sys.version_info >= (2, 5): + src = 'from __future__ import with_statement\n' + src + try: - # if we're using 2.5, use the with statement - if sys.version_info >= (2, 5): - parser.suite('from __future__ import with_statement\n' + - source + '\n') - else: - parser.suite(source + '\n') + parser.suite(src) except (SyntaxError, UnicodeEncodeError): return unhighlighted() else: