Hello community,
here is the log from the commit of package python-Sphinx for openSUSE:Factory checked in at 2012-05-29 11:44:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Sphinx (Old)
and /work/SRC/openSUSE:Factory/.python-Sphinx.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Sphinx", Maintainer is ""
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-Sphinx/python-Sphinx.changes 2011-11-25 10:13:52.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python-Sphinx.new/python-Sphinx.changes 2012-05-29 11:44:25.000000000 +0200
@@ -1,0 +2,41 @@
+Wed May 23 16:02:17 UTC 2012 - highwaystar.ru@gmail.com
+
+- python3 package added
+
+-------------------------------------------------------------------
+Wed May 23 12:59:54 UTC 2012 - saschpe@suse.de
+
+- Update to version 1.1.13:
+ * PR#40: Fix ``safe_repr`` function to decode bytestrings with non-ASCII
+ characters correctly.
+ * PR#37: Allow configuring sphinx-apidoc via ``SPHINX_APIDOC_OPTIONS``.
+ * PR#34: Restore Python 2.4 compatibility.
+ * PR#36: Make the "bibliography to TOC" fix in LaTeX output specific to
+ the document class.
+ * #695: When the highlight language "python" is specified explicitly,
+ do not try to parse the code to recognize non-Python snippets.
+ * #859: Fix exception under certain circumstances when not finding
+ appropriate objects to link to.
+ * #860: Do not crash when encountering invalid doctest examples, just
+ emit a warning.
+ * #864: Fix crash with some settings of :confval:`modindex_common_prefix`.
+ * #862: Fix handling of ``-D`` and ``-A`` options on Python 3.
+ * #851: Recognize and warn about circular toctrees, instead of running
+ into recursion errors.
+ * #853: Restore compatibility with docutils trunk.
+ * #852: Fix HtmlHelp index entry links again.
+ * #854: Fix inheritance_diagram raising attribute errors on builtins.
+ * #832: Fix crashes when putting comments or lone terms in a glossary.
+ * #834, #818: Fix HTML help language/encoding mapping for all Sphinx
+ supported languages.
+ * #844: Fix crashes when dealing with Unicode output in doctest extension.
+ * #831: Provide ``--project`` flag in setup_command as advertised.
+ * #875: Fix reading config files under Python 3.
+ * #876: Fix quickstart test under Python 3.
+ * #870: Fix spurious KeyErrors when removing documents.
+ * #892: Fix single-HTML builder misbehaving with the master document in a
+ subdirectory.
+ * #873: Fix assertion errors with empty ``only`` directives.
+ * #816: Fix encoding issues in the Qt help builder.
+
+-------------------------------------------------------------------
New Changes file:
--- /dev/null 2012-05-03 01:24:41.895590051 +0200
+++ /work/SRC/openSUSE:Factory/.python-Sphinx.new/python3-Sphinx.changes 2012-05-29 11:44:25.000000000 +0200
@@ -0,0 +1,5 @@
+-------------------------------------------------------------------
+Wed May 23 16:02:39 UTC 2012 - highwaystar.ru@gmail.com
+
+- python3-Sphinx package added
+
Old:
----
Sphinx-1.1.2.tar.gz
New:
----
Sphinx-1.1.3.tar.gz
python3-Sphinx-docs.patch
python3-Sphinx.changes
python3-Sphinx.spec
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-Sphinx.spec ++++++
--- /var/tmp/diff_new_pack.Ni2C8z/_old 2012-05-29 11:44:26.000000000 +0200
+++ /var/tmp/diff_new_pack.Ni2C8z/_new 2012-05-29 11:44:26.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-Sphinx
#
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,9 +16,8 @@
#
-
Name: python-Sphinx
-Version: 1.1.2
+Version: 1.1.3
Release: 0
Url: http://sphinx.pocoo.org
Summary: Python documentation generator
@@ -26,14 +25,14 @@
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/S/Sphinx/Sphinx-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: python-docutils
+BuildRequires: python-Jinja2
BuildRequires: python-devel
BuildRequires: python-distribute
-BuildRequires: python-Jinja2
-Requires: python-docutils
+BuildRequires: python-docutils
Requires: python-Jinja2
Requires: python-Pygments
Requires: python-distribute
+Requires: python-docutils
%if 0%{?suse_version}
Suggests: python-rst2pdf
%py_requires
++++++ python3-Sphinx.spec ++++++
#
# spec file for package python3-Sphinx
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python3-Sphinx
Version: 1.1.3
Release: 0
Url: http://sphinx.pocoo.org
Summary: Python documentation generator
License: BSD-2-Clause
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/S/Sphinx/Sphinx-%{version}.tar.gz
Patch0: python3-Sphinx-docs.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python3-Jinja2
BuildRequires: python3-devel
BuildRequires: python3-2to3
BuildRequires: python3-distribute
BuildRequires: python3-docutils
Requires: python3-Jinja2
Requires: python3-Pygments
Requires: python3-distribute
Requires: python3-docutils
%if 0%{?suse_version}
Suggests: python3-rst2pdf
%if 0%{?suse_version} > 1010
BuildRequires: fdupes
%endif
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 1140
%{!?python3_sitelib: %global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?py3_ver: %global py3_ver %(python3 -c "import sys; version=str(sys.version_info[0]) + '.' + str(sys.version_info[1]); print(version)" 2>/dev/null || echo PYTHON-NOT-FOUND)}
%endif
Requires: python(abi) = %{py3_ver}
%if 0%{?suse_version} && 0%{?suse_version} > 1140
BuildRequires: python3-base
%endif
%if %{?suse_version: %{suse_version} > 1110} %{!?suse_version:1}
BuildArchitectures: noarch
%endif
%description
Sphinx is a tool that makes it easy to create intelligent and beautiful
documentation for Python projects (or other documents consisting of multiple
reStructuredText sources), written by Georg Brandl. It was originally created
for the new Python documentation, and has excellent facilities for Python
project documentation, but C/C++ is supported as well, and more languages are
planned.
Sphinx uses reStructuredText as its markup language, and many of its strengths
come from the power and straightforwardness of reStructuredText and its parsing
and translating suite, the Docutils.
%package doc
Summary: Documentation for %{name}
Group: Documentation/Other
Requires: %{name} = %{version}
%description doc
Sphinx is a tool that makes it easy to create intelligent and beautiful
documentation for Python projects (or other documents consisting of multiple
reStructuredText sources), written by Georg Brandl. It was originally created
for the new Python documentation, and has excellent facilities for Python
project documentation, but C/C++ is supported as well, and more languages are
planned.
Sphinx uses reStructuredText as its markup language, and many of its strengths
come from the power and straightforwardness of reStructuredText and its parsing
and translating suite, the Docutils.
%prep
%setup -q -n Sphinx-%{version}
%patch0
sed -i '1d' sphinx/pycode/pgen2/token.py # Remove she-bang line
%build
2to3 . -w --nobackups
python3 setup.py build
sed -i 's/python/python3/g' doc/Makefile
cd doc && make html
rm _build/html/.buildinfo
mv _build/html ..
rm -rf _*
%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
for i in %{buildroot}%{_bindir}/*; do
mv "$i" "${i}-python%{py3_ver}"
done
%if 0%{?suse_version} > 1010
%fdupes %{buildroot}%{_prefix}
%endif
%find_lang sphinx
%files -f sphinx.lang
%defattr(-,root,root,-)
%doc AUTHORS CHANGES LICENSE README TODO
%{_bindir}/sphinx-*-python%{py3_ver}
%{python3_sitelib}/sphinx/
%{python3_sitelib}/Sphinx-%{version}-py%{py3_ver}.egg-info
%files doc
%defattr(-,root,root,-)
%doc EXAMPLES html
%changelog
++++++ Sphinx-1.1.2.tar.gz -> Sphinx-1.1.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/CHANGES new/Sphinx-1.1.3/CHANGES
--- old/Sphinx-1.1.2/CHANGES 2011-11-01 21:40:44.000000000 +0100
+++ new/Sphinx-1.1.3/CHANGES 2012-03-10 21:41:56.000000000 +0100
@@ -1,3 +1,61 @@
+Release 1.1.3 (Mar 10, 2012)
+============================
+
+* PR#40: Fix ``safe_repr`` function to decode bytestrings with non-ASCII
+ characters correctly.
+
+* PR#37: Allow configuring sphinx-apidoc via ``SPHINX_APIDOC_OPTIONS``.
+
+* PR#34: Restore Python 2.4 compatibility.
+
+* PR#36: Make the "bibliography to TOC" fix in LaTeX output specific to
+ the document class.
+
+* #695: When the highlight language "python" is specified explicitly,
+ do not try to parse the code to recognize non-Python snippets.
+
+* #859: Fix exception under certain circumstances when not finding
+ appropriate objects to link to.
+
+* #860: Do not crash when encountering invalid doctest examples, just
+ emit a warning.
+
+* #864: Fix crash with some settings of :confval:`modindex_common_prefix`.
+
+* #862: Fix handling of ``-D`` and ``-A`` options on Python 3.
+
+* #851: Recognize and warn about circular toctrees, instead of running
+ into recursion errors.
+
+* #853: Restore compatibility with docutils trunk.
+
+* #852: Fix HtmlHelp index entry links again.
+
+* #854: Fix inheritance_diagram raising attribute errors on builtins.
+
+* #832: Fix crashes when putting comments or lone terms in a glossary.
+
+* #834, #818: Fix HTML help language/encoding mapping for all Sphinx
+ supported languages.
+
+* #844: Fix crashes when dealing with Unicode output in doctest extension.
+
+* #831: Provide ``--project`` flag in setup_command as advertised.
+
+* #875: Fix reading config files under Python 3.
+
+* #876: Fix quickstart test under Python 3.
+
+* #870: Fix spurious KeyErrors when removing documents.
+
+* #892: Fix single-HTML builder misbehaving with the master document in a
+ subdirectory.
+
+* #873: Fix assertion errors with empty ``only`` directives.
+
+* #816: Fix encoding issues in the Qt help builder.
+
+
Release 1.1.2 (Nov 1, 2011) -- 1.1.1 is a silly version number anyway!
======================================================================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/PKG-INFO new/Sphinx-1.1.3/PKG-INFO
--- old/Sphinx-1.1.2/PKG-INFO 2011-11-01 21:41:25.000000000 +0100
+++ new/Sphinx-1.1.3/PKG-INFO 2012-03-10 21:50:36.000000000 +0100
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.0
Name: Sphinx
-Version: 1.1.2
+Version: 1.1.3
Summary: Python documentation generator
Home-page: http://sphinx.pocoo.org/
Author: Georg Brandl
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/Sphinx.egg-info/PKG-INFO new/Sphinx-1.1.3/Sphinx.egg-info/PKG-INFO
--- old/Sphinx-1.1.2/Sphinx.egg-info/PKG-INFO 2011-11-01 21:41:25.000000000 +0100
+++ new/Sphinx-1.1.3/Sphinx.egg-info/PKG-INFO 2012-03-10 21:50:35.000000000 +0100
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.0
Name: Sphinx
-Version: 1.1.2
+Version: 1.1.3
Summary: Python documentation generator
Home-page: http://sphinx.pocoo.org/
Author: Georg Brandl
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/doc/ext/math.rst new/Sphinx-1.1.3/doc/ext/math.rst
--- old/Sphinx-1.1.2/doc/ext/math.rst 2011-11-01 08:38:43.000000000 +0100
+++ new/Sphinx-1.1.3/doc/ext/math.rst 2012-02-19 11:54:47.000000000 +0100
@@ -24,6 +24,10 @@
standard for plain-text math notation and has the added advantage that no
further translation is necessary when building LaTeX output.
+Keep in mind that when you put math markup in **Python docstrings** read by
+:mod:`autodoc `, you either have to double all backslashes,
+or use Python raw strings (``r"raw"``).
+
:mod:`.mathbase` defines these new markup elements:
.. rst:role:: math
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/doc/markup/misc.rst new/Sphinx-1.1.3/doc/markup/misc.rst
--- old/Sphinx-1.1.2/doc/markup/misc.rst 2011-10-09 23:28:15.000000000 +0200
+++ new/Sphinx-1.1.3/doc/markup/misc.rst 2012-03-10 21:38:03.000000000 +0100
@@ -182,6 +182,13 @@
The format of the current builder (``html``, ``latex`` or ``text``) is always
set as a tag.
+ .. note::
+
+ Due to docutils' specifics of parsing of directive content, you cannot put
+ a section with the same level as the main document heading inside an
+ ``only`` directive. Such sections will appear to be ignored in the parsed
+ document.
+
.. versionadded:: 0.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/setup.cfg new/Sphinx-1.1.3/setup.cfg
--- old/Sphinx-1.1.2/setup.cfg 2011-11-01 21:41:25.000000000 +0100
+++ new/Sphinx-1.1.3/setup.cfg 2012-03-10 21:50:36.000000000 +0100
@@ -1,22 +1,22 @@
+[compile_catalog]
+directory = sphinx/locale/
+domain = sphinx
+
+[update_catalog]
+domain = sphinx
+output_dir = sphinx/locale/
+input_file = sphinx/locale/sphinx.pot
+
[egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0
-[aliases]
-release = egg_info -RDb ''
-
[extract_messages]
+keywords = _ l_ lazy_gettext
mapping_file = babel.cfg
output_file = sphinx/locale/sphinx.pot
-keywords = _ l_ lazy_gettext
-
-[update_catalog]
-input_file = sphinx/locale/sphinx.pot
-domain = sphinx
-output_dir = sphinx/locale/
-[compile_catalog]
-domain = sphinx
-directory = sphinx/locale/
+[aliases]
+release = egg_info -RDb ''
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/__init__.py new/Sphinx-1.1.3/sphinx/__init__.py
--- old/Sphinx-1.1.2/sphinx/__init__.py 2011-11-01 21:39:01.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/__init__.py 2012-03-10 21:42:13.000000000 +0100
@@ -15,8 +15,8 @@
import sys
from os import path
-__version__ = '1.1.2'
-__released__ = '1.1.2' # used when Sphinx builds its own docs
+__version__ = '1.1.3'
+__released__ = '1.1.3' # used when Sphinx builds its own docs
package_dir = path.abspath(path.dirname(__file__))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/apidoc.py new/Sphinx-1.1.3/sphinx/apidoc.py
--- old/Sphinx-1.1.2/sphinx/apidoc.py 2011-11-01 15:41:08.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/apidoc.py 2012-01-29 10:12:28.000000000 +0100
@@ -20,12 +20,15 @@
from os import path
# automodule options
-OPTIONS = [
- 'members',
- 'undoc-members',
- # 'inherited-members', # disabled because there's a bug in sphinx
- 'show-inheritance',
-]
+if 'SPHINX_APIDOC_OPTIONS' in os.environ:
+ OPTIONS = os.environ['SPHINX_APIDOC_OPTIONS'].split(',')
+else:
+ OPTIONS = [
+ 'members',
+ 'undoc-members',
+ # 'inherited-members', # disabled because there's a bug in sphinx
+ 'show-inheritance',
+ ]
INITPY = '__init__.py'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/builders/changes.py new/Sphinx-1.1.3/sphinx/builders/changes.py
--- old/Sphinx-1.1.2/sphinx/builders/changes.py 2011-10-09 23:28:15.000000000 +0200
+++ new/Sphinx-1.1.3/sphinx/builders/changes.py 2012-02-19 11:54:47.000000000 +0100
@@ -11,7 +11,6 @@
import codecs
from os import path
-from cgi import escape
from sphinx import package_dir
from sphinx.util import copy_static_entry
@@ -20,6 +19,7 @@
from sphinx.builders import Builder
from sphinx.util.osutil import ensuredir, os_path
from sphinx.util.console import bold
+from sphinx.util.pycompat import htmlescape
class ChangesBuilder(Builder):
@@ -115,7 +115,7 @@
'.. deprecated:: %s' % version]
def hl(no, line):
- line = '<a name="L%s"> </a>' % no + escape(line)
+ line = '<a name="L%s"> </a>' % no + htmlescape(line)
for x in hltext:
if x in line:
line = '<span class="hl">%s</span>' % line
@@ -125,7 +125,10 @@
self.info(bold('copying source files...'))
for docname in self.env.all_docs:
f = codecs.open(self.env.doc2path(docname), 'r', 'latin1')
- lines = f.readlines()
+ try:
+ lines = f.readlines()
+ finally:
+ f.close()
targetfn = path.join(self.outdir, 'rst', os_path(docname)) + '.html'
ensuredir(path.dirname(targetfn))
f = codecs.open(targetfn, 'w', 'latin1')
@@ -148,7 +151,7 @@
self.outdir, self)
def hl(self, text, version):
- text = escape(text)
+ text = htmlescape(text)
for directive in ['versionchanged', 'versionadded', 'deprecated']:
text = text.replace('.. %s:: %s' % (directive, version),
'<b>.. %s:: %s</b>' % (directive, version))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/builders/html.py new/Sphinx-1.1.3/sphinx/builders/html.py
--- old/Sphinx-1.1.2/sphinx/builders/html.py 2011-11-01 08:38:43.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/builders/html.py 2012-03-10 21:38:03.000000000 +0100
@@ -698,9 +698,12 @@
ctx = self.globalcontext.copy()
# current_page_name is backwards compatibility
ctx['pagename'] = ctx['current_page_name'] = pagename
+ default_baseuri = self.get_target_uri(pagename)
+ # in the singlehtml builder, default_baseuri still contains an #anchor
+ # part, which relative_uri doesn't really like...
+ default_baseuri = default_baseuri.rsplit('#', 1)[0]
- def pathto(otheruri, resource=False,
- baseuri=self.get_target_uri(pagename)):
+ def pathto(otheruri, resource=False, baseuri=default_baseuri):
if resource and '://' in otheruri:
# allow non-local resources given by scheme
return otheruri
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/builders/htmlhelp.py new/Sphinx-1.1.3/sphinx/builders/htmlhelp.py
--- old/Sphinx-1.1.2/sphinx/builders/htmlhelp.py 2011-11-01 15:41:08.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/builders/htmlhelp.py 2012-02-19 11:54:47.000000000 +0100
@@ -11,7 +11,6 @@
"""
import os
-import cgi
import codecs
from os import path
@@ -19,6 +18,7 @@
from sphinx import addnodes
from sphinx.builders.html import StandaloneHTMLBuilder
+from sphinx.util.pycompat import htmlescape
# Project file (*.hhp) template. 'outname' is the file basename (like
@@ -124,20 +124,31 @@
# See http://msdn.microsoft.com/en-us/library/ms930130.aspx for more.
chm_locales = {
# lang: LCID, encoding
- 'cs': (0x405, 'iso8859_2'),
- 'de': (0x407, 'iso8859_1'),
- 'en': (0x409, 'iso8859_1'),
- 'es': (0x40a, 'iso8859_1'),
- 'fi': (0x40b, 'iso8859_1'),
- 'fr': (0x40c, 'iso8859_1'),
- 'it': (0x410, 'iso8859_1'),
+ 'ca': (0x403, 'cp1252'),
+ 'cs': (0x405, 'cp1250'),
+ 'da': (0x406, 'cp1252'),
+ 'de': (0x407, 'cp1252'),
+ 'en': (0x409, 'cp1252'),
+ 'es': (0x40a, 'cp1252'),
+ 'et': (0x425, 'cp1257'),
+ 'fa': (0x429, 'cp1256'),
+ 'fi': (0x40b, 'cp1252'),
+ 'fr': (0x40c, 'cp1252'),
+ 'hr': (0x41a, 'cp1250'),
+ 'hu': (0x40e, 'cp1250'),
+ 'it': (0x410, 'cp1252'),
'ja': (0x411, 'cp932'),
+ 'ko': (0x412, 'cp949'),
+ 'lt': (0x427, 'cp1257'),
'lv': (0x426, 'cp1257'),
- 'nl': (0x413, 'iso8859_1'),
- 'pl': (0x415, 'iso8859_2'),
- 'pt_BR': (0x416, 'iso8859_1'),
+ 'nl': (0x413, 'cp1252'),
+ 'pl': (0x415, 'cp1250'),
+ 'pt_BR': (0x416, 'cp1252'),
'ru': (0x419, 'cp1251'),
- 'sl': (0x424, 'iso8859_2'),
+ 'sk': (0x41b, 'cp1250'),
+ 'sl': (0x424, 'cp1250'),
+ 'sv': (0x41d, 'cp1252'),
+ 'tr': (0x41f, 'cp1254'),
'uk_UA': (0x422, 'cp1251'),
'zh_CN': (0x804, 'cp936'),
'zh_TW': (0x404, 'cp950'),
@@ -230,7 +241,7 @@
write_toc(subnode, ullevel)
elif isinstance(node, nodes.reference):
link = node['refuri']
- title = cgi.escape(node.astext()).replace('"','"')
+ title = htmlescape(node.astext()).replace('"','"')
f.write(object_sitemap % (title, link))
elif isinstance(node, nodes.bullet_list):
if ullevel != 0:
@@ -259,20 +270,20 @@
def write_index(title, refs, subitems):
def write_param(name, value):
item = ' <param name="%s" value="%s">\n' % \
- (name, value[1])
+ (name, value)
f.write(item)
- title = cgi.escape(title)
+ title = htmlescape(title)
f.write('<LI> <OBJECT type="text/sitemap">\n')
write_param('Keyword', title)
if len(refs) == 0:
write_param('See Also', title)
elif len(refs) == 1:
- write_param('Local', refs[0])
+ write_param('Local', refs[0][1])
else:
for i, ref in enumerate(refs):
# XXX: better title?
- write_param('Name', '[%d] %s' % (i, ref))
- write_param('Local', ref)
+ write_param('Name', '[%d] %s' % (i, ref[1]))
+ write_param('Local', ref[1])
f.write('</OBJECT>\n')
if subitems:
f.write('<UL> ')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/builders/qthelp.py new/Sphinx-1.1.3/sphinx/builders/qthelp.py
--- old/Sphinx-1.1.2/sphinx/builders/qthelp.py 2011-11-01 15:41:08.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/builders/qthelp.py 2012-03-10 21:49:51.000000000 +0100
@@ -14,12 +14,13 @@
import codecs
import posixpath
from os import path
-from cgi import escape
from docutils import nodes
from sphinx import addnodes
from sphinx.builders.html import StandaloneHTMLBuilder
+from sphinx.util import force_decode
+from sphinx.util.pycompat import htmlescape
_idpattern = re.compile(
@@ -130,16 +131,16 @@
for indexname, indexcls, content, collapse in self.domain_indices:
item = section_template % {'title': indexcls.localname,
'ref': '%s.html' % indexname}
- sections.append((' ' * 4 * 4 + item).encode('utf-8'))
+ sections.append(' ' * 4 * 4 + item)
# sections may be unicode strings or byte strings, we have to make sure
- # they are all byte strings before joining them
+ # they are all unicode strings before joining them
new_sections = []
for section in sections:
- if isinstance(section, unicode):
- new_sections.append(section.encode('utf-8'))
+ if not isinstance(section, unicode):
+ new_sections.append(force_decode(section, None))
else:
new_sections.append(section)
- sections = u'\n'.encode('utf-8').join(new_sections)
+ sections = u'\n'.join(new_sections)
# keywords
keywords = []
@@ -147,7 +148,7 @@
for (key, group) in index:
for title, (refs, subitems) in group:
keywords.extend(self.build_keywords(title, refs, subitems))
- keywords = '\n'.join(keywords)
+ keywords = u'\n'.join(keywords)
# files
if not outdir.endswith(os.sep):
@@ -164,7 +165,7 @@
fn.endswith('.html'):
filename = path.join(root, fn)[olen:]
projectfiles.append(file_template %
- {'filename': escape(filename)})
+ {'filename': htmlescape(filename)})
projectfiles = '\n'.join(projectfiles)
# it seems that the "namespace" may not contain non-alphanumeric
@@ -179,12 +180,12 @@
f = codecs.open(path.join(outdir, outname+'.qhp'), 'w', 'utf-8')
try:
f.write(project_template % {
- 'outname': escape(outname),
- 'title': escape(self.config.html_title),
- 'version': escape(self.config.version),
- 'project': escape(self.config.project),
- 'namespace': escape(nspace),
- 'masterdoc': escape(self.config.master_doc),
+ 'outname': htmlescape(outname),
+ 'title': htmlescape(self.config.html_title),
+ 'version': htmlescape(self.config.version),
+ 'project': htmlescape(self.config.project),
+ 'namespace': htmlescape(nspace),
+ 'masterdoc': htmlescape(self.config.master_doc),
'sections': sections,
'keywords': keywords,
'files': projectfiles})
@@ -199,10 +200,10 @@
f = codecs.open(path.join(outdir, outname+'.qhcp'), 'w', 'utf-8')
try:
f.write(collection_template % {
- 'outname': escape(outname),
- 'title': escape(self.config.html_short_title),
- 'homepage': escape(homepage),
- 'startpage': escape(startpage)})
+ 'outname': htmlescape(outname),
+ 'title': htmlescape(self.config.html_short_title),
+ 'homepage': htmlescape(homepage),
+ 'startpage': htmlescape(startpage)})
finally:
f.close()
@@ -220,14 +221,14 @@
return True
def write_toc(self, node, indentlevel=4):
+ # XXX this should return a Unicode string, not a bytestring
parts = []
if self.isdocnode(node):
refnode = node.children[0][0]
link = refnode['refuri']
- title = escape(refnode.astext()).replace('"','"')
- item = '<section title="%(title)s" ref="%(ref)s">' % {
- 'title': title,
- 'ref': link}
+ title = htmlescape(refnode.astext()).replace('"', '"')
+ item = '<section title="%(title)s" ref="%(ref)s">' % \
+ {'title': title, 'ref': link}
parts.append(' '*4*indentlevel + item)
for subnode in node.children[1]:
parts.extend(self.write_toc(subnode, indentlevel+1))
@@ -237,7 +238,7 @@
parts.extend(self.write_toc(subnode, indentlevel))
elif isinstance(node, nodes.reference):
link = node['refuri']
- title = escape(node.astext()).replace('"','"')
+ title = htmlescape(node.astext()).replace('"','"')
item = section_template % {'title': title, 'ref': link}
item = u' ' * 4 * indentlevel + item
parts.append(item.encode('ascii', 'xmlcharrefreplace'))
@@ -274,7 +275,7 @@
def build_keywords(self, title, refs, subitems):
keywords = []
- title = escape(title)
+ title = htmlescape(title)
# if len(refs) == 0: # XXX
# write_param('See Also', title)
if len(refs) == 1:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/cmdline.py new/Sphinx-1.1.3/sphinx/cmdline.py
--- old/Sphinx-1.1.2/sphinx/cmdline.py 2011-11-01 08:38:43.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/cmdline.py 2012-03-10 21:38:40.000000000 +0100
@@ -22,7 +22,7 @@
from sphinx.application import Sphinx
from sphinx.util import Tee, format_exception_cut_frames, save_traceback
from sphinx.util.console import red, nocolor, color_terminal
-from sphinx.util.pycompat import terminal_safe
+from sphinx.util.pycompat import terminal_safe, bytes
def usage(argv, msg=None):
@@ -137,7 +137,7 @@
try:
val = int(val)
except ValueError:
- if likely_encoding:
+ if likely_encoding and isinstance(val, bytes):
try:
val = val.decode(likely_encoding)
except UnicodeError:
@@ -153,7 +153,7 @@
try:
val = int(val)
except ValueError:
- if likely_encoding:
+ if likely_encoding and isinstance(val, bytes):
try:
val = val.decode(likely_encoding)
except UnicodeError:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/config.py new/Sphinx-1.1.3/sphinx/config.py
--- old/Sphinx-1.1.2/sphinx/config.py 2011-11-01 15:16:58.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/config.py 2012-03-10 21:38:40.000000000 +0100
@@ -194,8 +194,9 @@
# we promise to have the config dir as current dir while the
# config file is executed
os.chdir(dirname)
- # get config source
- f = open(config_file, 'rU')
+ # get config source -- 'b' is a no-op under 2.x, while 'U' is
+ # ignored under 3.x (but 3.x compile() accepts \r\n newlines)
+ f = open(config_file, 'rbU')
try:
source = f.read()
finally:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/domains/cpp.py new/Sphinx-1.1.3/sphinx/domains/cpp.py
--- old/Sphinx-1.1.2/sphinx/domains/cpp.py 2011-11-01 08:38:43.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/domains/cpp.py 2012-01-29 09:49:09.000000000 +0100
@@ -34,10 +34,10 @@
_operator_re = re.compile(r'''(?x)
\[\s*\]
| \(\s*\)
- | [!<>=/*%+|&^-]=?
| \+\+ | --
- | (<<|>>)=? | ~ | && | \| | \|\|
| ->\*? | \,
+ | (<<|>>)=? | && | \|\|
+ | [!<>=/*%+|&^~-]=?
''')
_id_shortwords = {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/domains/python.py new/Sphinx-1.1.3/sphinx/domains/python.py
--- old/Sphinx-1.1.2/sphinx/domains/python.py 2011-11-01 08:38:43.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/domains/python.py 2012-02-19 11:54:47.000000000 +0100
@@ -525,7 +525,8 @@
# it's a submodule
if prev_modname == package:
# first submodule - make parent a group head
- entries[-1][1] = 1
+ if entries:
+ entries[-1][1] = 1
elif not prev_modname.startswith(package):
# submodule without parent in list, add dummy entry
entries.append([stripped + package, 1, '', '', '', '', ''])
@@ -625,22 +626,23 @@
newname = None
if searchmode == 1:
objtypes = self.objtypes_for_role(type)
- if modname and classname:
- fullname = modname + '.' + classname + '.' + name
- if fullname in objects and objects[fullname][1] in objtypes:
- newname = fullname
- if not newname:
- if modname and modname + '.' + name in objects and \
- objects[modname + '.' + name][1] in objtypes:
- newname = modname + '.' + name
- elif name in objects and objects[name][1] in objtypes:
- newname = name
- else:
- # "fuzzy" searching mode
- searchname = '.' + name
- matches = [(oname, objects[oname]) for oname in objects
- if oname.endswith(searchname)
- and objects[oname][1] in objtypes]
+ if objtypes is not None:
+ if modname and classname:
+ fullname = modname + '.' + classname + '.' + name
+ if fullname in objects and objects[fullname][1] in objtypes:
+ newname = fullname
+ if not newname:
+ if modname and modname + '.' + name in objects and \
+ objects[modname + '.' + name][1] in objtypes:
+ newname = modname + '.' + name
+ elif name in objects and objects[name][1] in objtypes:
+ newname = name
+ else:
+ # "fuzzy" searching mode
+ searchname = '.' + name
+ matches = [(oname, objects[oname]) for oname in objects
+ if oname.endswith(searchname)
+ and objects[oname][1] in objtypes]
else:
# NOTE: searching for exact match, object type is not considered
if name in objects:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/domains/std.py new/Sphinx-1.1.3/sphinx/domains/std.py
--- old/Sphinx-1.1.2/sphinx/domains/std.py 2011-11-01 15:41:08.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/domains/std.py 2012-03-10 21:39:32.000000000 +0100
@@ -245,6 +245,9 @@
continue
# unindented line -> a term
if line and not line[0].isspace():
+ # enable comments
+ if line.startswith('.. '):
+ continue
# first term of definition
if in_definition:
if not was_empty:
@@ -315,7 +318,9 @@
term += system_messages
defnode = nodes.definition()
- self.state.nested_parse(definition, definition.items[0][1], defnode)
+ if definition:
+ self.state.nested_parse(definition, definition.items[0][1],
+ defnode)
items.append((termtexts,
nodes.definition_list_item('', term, defnode)))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/environment.py new/Sphinx-1.1.3/sphinx/environment.py
--- old/Sphinx-1.1.2/sphinx/environment.py 2011-11-01 15:41:08.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/environment.py 2012-03-10 21:38:40.000000000 +0100
@@ -1164,7 +1164,12 @@
def get_toc_for(self, docname, builder):
"""Return a TOC nodetree -- for use on the same page only!"""
- toc = self.tocs[docname].deepcopy()
+ try:
+ toc = self.tocs[docname].deepcopy()
+ except KeyError:
+ # the document does not exist anymore: return a dummy node that
+ # renders to nothing
+ return nodes.paragraph()
self.process_only_nodes(toc, builder, docname)
for node in toc.traverse(nodes.reference):
node['refuri'] = node['anchorname'] or '#'
@@ -1313,12 +1318,14 @@
subnode['iscurrent'] = True
subnode = subnode.parent
- def _entries_from_toctree(toctreenode, separate=False, subtree=False):
+ def _entries_from_toctree(toctreenode, parents,
+ separate=False, subtree=False):
"""Return TOC entries for a toctree node."""
refs = [(e[0], str(e[1])) for e in toctreenode['entries']]
entries = []
for (title, ref) in refs:
try:
+ refdoc = None
if url_re.match(ref):
reference = nodes.reference('', '', internal=False,
refuri=ref, anchorname='',
@@ -1341,6 +1348,12 @@
# don't show subitems
toc = nodes.bullet_list('', item)
else:
+ if ref in parents:
+ self.warn(ref, 'circular toctree references '
+ 'detected, ignoring: %s <- %s' %
+ (ref, ' <- '.join(parents)))
+ continue
+ refdoc = ref
toc = self.tocs[ref].deepcopy()
self.process_only_nodes(toc, builder, ref)
if title and toc.children and len(toc.children) == 1:
@@ -1376,8 +1389,9 @@
if not (toctreenode.get('hidden', False)
and not includehidden):
i = toctreenode.parent.index(toctreenode) + 1
- for item in _entries_from_toctree(toctreenode,
- subtree=True):
+ for item in _entries_from_toctree(
+ toctreenode, [refdoc] + parents,
+ subtree=True):
toctreenode.parent.insert(i, item)
i += 1
toctreenode.parent.remove(toctreenode)
@@ -1398,7 +1412,7 @@
# NOTE: previously, this was separate=True, but that leads to artificial
# separation when two or more toctree entries form a logical unit, so
# separating mode is no longer used -- it's kept here for history's sake
- tocentries = _entries_from_toctree(toctree, separate=False)
+ tocentries = _entries_from_toctree(toctree, [], separate=False)
if not tocentries:
return None
@@ -1498,19 +1512,21 @@
self.warn_node(msg % {'target': target}, node)
def process_only_nodes(self, doctree, builder, fromdocname=None):
+ # A comment on the comment() nodes being inserted: replacing by [] would
+ # result in a "Losing ids" exception if there is a target node before
+ # the only node, so we make sure docutils can transfer the id to
+ # something, even if it's just a comment and will lose the id anyway...
for node in doctree.traverse(addnodes.only):
try:
ret = builder.tags.eval_condition(node['expr'])
except Exception, err:
self.warn_node('exception while evaluating only '
'directive expression: %s' % err, node)
- node.replace_self(node.children)
+ node.replace_self(node.children or nodes.comment())
else:
if ret:
- node.replace_self(node.children)
+ node.replace_self(node.children or nodes.comment())
else:
- # replacing by [] would result in an "Losing ids" exception
- # if there is a target node before the only node
node.replace_self(nodes.comment())
def assign_section_numbers(self):
@@ -1686,7 +1702,11 @@
def collect_relations(self):
relations = {}
getinc = self.toctree_includes.get
- def collect(parents, docname, previous, next):
+ def collect(parents, parents_set, docname, previous, next):
+ # circular relationship?
+ if docname in parents_set:
+ # we will warn about this in resolve_toctree()
+ return
includes = getinc(docname)
# previous
if not previous:
@@ -1723,9 +1743,10 @@
for subindex, args in enumerate(izip(includes,
[None] + includes,
includes[1:] + [None])):
- collect([(docname, subindex)] + parents, *args)
+ collect([(docname, subindex)] + parents,
+ parents_set.union([docname]), *args)
relations[docname] = [parents[0][0], previous, next]
- collect([(None, 0)], self.config.master_doc, None, None)
+ collect([(None, 0)], set(), self.config.master_doc, None, None)
return relations
def check_consistency(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/ext/autodoc.py new/Sphinx-1.1.3/sphinx/ext/autodoc.py
--- old/Sphinx-1.1.2/sphinx/ext/autodoc.py 2011-11-01 08:38:43.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/ext/autodoc.py 2012-03-10 21:38:03.000000000 +0100
@@ -512,9 +512,13 @@
# unbound method objects instead of function objects);
# using keys() because apparently there are objects for which
# __dict__ changes while getting attributes
- obj_dict = self.get_attr(self.object, '__dict__')
- members = [(mname, self.get_attr(self.object, mname, None))
- for mname in obj_dict.keys()]
+ try:
+ obj_dict = self.get_attr(self.object, '__dict__')
+ except AttributeError:
+ members = []
+ else:
+ members = [(mname, self.get_attr(self.object, mname, None))
+ for mname in obj_dict.keys()]
membernames = set(m[0] for m in members)
# add instance attributes from the analyzer
if self.analyzer:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/ext/doctest.py new/Sphinx-1.1.3/sphinx/ext/doctest.py
--- old/Sphinx-1.1.2/sphinx/ext/doctest.py 2011-11-01 08:38:44.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/ext/doctest.py 2012-03-10 21:39:21.000000000 +0100
@@ -23,9 +23,11 @@
from docutils.parsers.rst import directives
from sphinx.builders import Builder
+from sphinx.util import force_decode
from sphinx.util.nodes import set_source_info
from sphinx.util.compat import Directive
from sphinx.util.console import bold
+from sphinx.util.pycompat import bytes
blankline_re = re.compile(r'^\s*<BLANKLINE>', re.MULTILINE)
doctestopt_re = re.compile(r'#\s*doctest:.+$', re.MULTILINE)
@@ -231,6 +233,8 @@
self.info(text, nonl=True)
if self.app.quiet:
self.warn(text)
+ if isinstance(text, bytes):
+ text = force_decode(text, None)
self.outfile.write(text)
def get_target_uri(self, docname, typ=None):
@@ -375,8 +379,14 @@
for code in group.tests:
if len(code) == 1:
# ordinary doctests (code/output interleaved)
- test = parser.get_doctest(code[0].code, {}, group.name,
- filename, code[0].lineno)
+ try:
+ test = parser.get_doctest(code[0].code, {}, group.name,
+ filename, code[0].lineno)
+ except Exception:
+ self.warn('ignoring invalid doctest code: %r' %
+ code[0].code,
+ '%s:%s' % (filename, code[0].lineno))
+ continue
if not test.examples:
continue
for example in test.examples:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/ext/inheritance_diagram.py new/Sphinx-1.1.3/sphinx/ext/inheritance_diagram.py
--- old/Sphinx-1.1.2/sphinx/ext/inheritance_diagram.py 2011-10-09 23:28:15.000000000 +0200
+++ new/Sphinx-1.1.3/sphinx/ext/inheritance_diagram.py 2012-02-19 11:54:47.000000000 +0100
@@ -39,6 +39,7 @@
import re
import sys
import inspect
+import __builtin__
try:
from hashlib import md5
except ImportError:
@@ -142,7 +143,7 @@
displayed node names.
"""
all_classes = {}
- builtins = __builtins__.values()
+ builtins = vars(__builtin__).values()
def recurse(cls):
if not show_builtins and cls in builtins:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/ext/intersphinx.py new/Sphinx-1.1.3/sphinx/ext/intersphinx.py
--- old/Sphinx-1.1.2/sphinx/ext/intersphinx.py 2011-11-01 15:41:08.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/ext/intersphinx.py 2012-03-10 18:57:10.000000000 +0100
@@ -30,6 +30,7 @@
import urllib2
import posixpath
from os import path
+import re
from docutils import nodes
@@ -99,7 +100,12 @@
assert not buf
for line in split_lines(read_chunks()):
- name, type, prio, location, dispname = line.rstrip().split(None, 4)
+ # be careful to handle names with embedded spaces correctly
+ m = re.match(r'(?x)(.+?)\s+(\S*:\S*)\s+(\S+)\s+(\S+)\s+(.*)',
+ line.rstrip())
+ if not m:
+ continue
+ name, type, prio, location, dispname = m.groups()
if location.endswith(u'$'):
location = location[:-1] + name
location = join(uri, location)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/highlighting.py new/Sphinx-1.1.3/sphinx/highlighting.py
--- old/Sphinx-1.1.2/sphinx/highlighting.py 2011-11-01 08:38:44.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/highlighting.py 2012-02-19 11:54:47.000000000 +0100
@@ -10,7 +10,6 @@
"""
import sys
-import cgi
import re
import textwrap
@@ -20,6 +19,7 @@
# parser is not available on Jython
parser = None
+from sphinx.util.pycompat import htmlescape
from sphinx.util.texescape import tex_hl_escape_map_new
from sphinx.ext import doctest
@@ -105,7 +105,7 @@
def unhighlighted(self, source):
if self.dest == 'html':
- return '<pre>' + cgi.escape(source) + '</pre>\n'
+ return '<pre>' + htmlescape(source) + '</pre>\n'
else:
# first, escape highlighting characters like Pygments does
source = source.translate(escape_hl_chars)
@@ -153,7 +153,7 @@
else:
return True
- def highlight_block(self, source, lang, warn=None, **kwargs):
+ def highlight_block(self, source, lang, warn=None, force=False, **kwargs):
if not isinstance(source, unicode):
source = source.decode()
if not pygments:
@@ -164,12 +164,14 @@
if source.startswith('>>>'):
# interactive session
lexer = lexers['pycon']
- else:
+ elif not force:
# maybe Python -- try parsing it
if self.try_parse(source):
lexer = lexers['python']
else:
return self.unhighlighted(source)
+ else:
+ lexer = lexers['python']
elif lang in ('python3', 'py3') and source.startswith('>>>'):
# for py3, recognize interactive sessions, but do not try parsing...
lexer = lexers['pycon3']
Files old/Sphinx-1.1.2/sphinx/locale/fr/LC_MESSAGES/sphinx.mo and new/Sphinx-1.1.3/sphinx/locale/fr/LC_MESSAGES/sphinx.mo differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/locale/fr/LC_MESSAGES/sphinx.po new/Sphinx-1.1.3/sphinx/locale/fr/LC_MESSAGES/sphinx.po
--- old/Sphinx-1.1.2/sphinx/locale/fr/LC_MESSAGES/sphinx.po 2011-11-01 08:38:44.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/locale/fr/LC_MESSAGES/sphinx.po 2012-01-29 10:07:39.000000000 +0100
@@ -303,9 +303,8 @@
msgstr "%s (module)"
#: sphinx/domains/python.py:491
-#, fuzzy
msgid "Python Module Index"
-msgstr "Index du module"
+msgstr "Index des modules Python"
#: sphinx/domains/python.py:492
msgid "modules"
@@ -324,7 +323,6 @@
msgstr "méthode"
#: sphinx/domains/python.py:564
-#, fuzzy
msgid "class method"
msgstr "méthode de classe"
@@ -437,9 +435,8 @@
msgstr ""
#: sphinx/ext/viewcode.py:131
-#, fuzzy
msgid "Module code"
-msgstr "module"
+msgstr "Code du module"
#: sphinx/ext/viewcode.py:137
#, python-format
@@ -544,9 +541,8 @@
msgstr "Go"
#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
-#, fuzzy
msgid "Enter search terms or a module, class or function name."
-msgstr "Saisissez un nom de module, classe ou fonction."
+msgstr "Saisissez un mot clef ou un nom de module, classe ou fonction."
#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
msgid "Show Source"
@@ -673,7 +669,6 @@
msgstr "Activez le JavaScript pour que la recherche fonctionne."
#: sphinx/themes/basic/search.html:29
-#, fuzzy
msgid ""
"From here you can search these documents. Enter your search\n"
" words into the box below and click \"search\". Note that the search\n"
@@ -684,7 +679,7 @@
"termes\n"
" de votre recherche dans le champs ci-dessous et cliquez sur "
"\"rechercher\". Notez que la fonctionnalité de recherche\n"
-" va automatique chercher pour tous les mots. Les pages\n"
+" va automatiquement chercher parmi l'ensemble les mots. Les pages\n"
" contenant moins de mots n'apparaîtront pas dans la liste des "
"résultats."
@@ -776,7 +771,6 @@
msgstr "Suite de la page précédente"
#: sphinx/writers/latex.py:681
-#, fuzzy
msgid "Continued on next page"
msgstr "Suite sur la page suivante"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/setup_command.py new/Sphinx-1.1.3/sphinx/setup_command.py
--- old/Sphinx-1.1.2/sphinx/setup_command.py 2011-10-09 23:28:16.000000000 +0200
+++ new/Sphinx-1.1.3/sphinx/setup_command.py 2012-03-10 21:39:01.000000000 +0100
@@ -81,6 +81,7 @@
self.fresh_env = self.all_files = False
self.source_dir = self.build_dir = None
self.builder = 'html'
+ self.project = ''
self.version = ''
self.release = ''
self.today = ''
@@ -125,6 +126,8 @@
else:
status_stream = sys.stdout
confoverrides = {}
+ if self.project:
+ confoverrides['project'] = self.project
if self.version:
confoverrides['version'] = self.version
if self.release:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/texinputs/sphinx.sty new/Sphinx-1.1.3/sphinx/texinputs/sphinx.sty
--- old/Sphinx-1.1.2/sphinx/texinputs/sphinx.sty 2011-11-01 08:38:44.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/texinputs/sphinx.sty 2012-01-29 10:11:30.000000000 +0100
@@ -402,10 +402,15 @@
}
-% Fix the index and bibliography environments to add an entry to the Table of
+% Fix the index environment to add an entry to the Table of
% Contents; this is much nicer than just having to jump to the end of the book
% and flip around, especially with multiple indexes.
%
+% A similiar fix must be done to the bibliography environment, although
+% dependant on document class. In particular, the '\addcontentsline' command
+% should use 'chapter' for a report and 'section' for an article.
+% See sphinxmanual.cls and sphinxhowto.cls for specific fixes.
+%
\let\py@OldTheindex=\theindex
\renewcommand{\theindex}{
\cleardoublepage
@@ -414,14 +419,6 @@
\addcontentsline{toc}{chapter}{\indexname}
}
-\let\py@OldThebibliography=\thebibliography
-\renewcommand{\thebibliography}[1]{
- \cleardoublepage
- \phantomsection
- \py@OldThebibliography{1}
- \addcontentsline{toc}{chapter}{\bibname}
-}
-
% Include hyperref last.
\RequirePackage[colorlinks,breaklinks,
linkcolor=InnerLinkColor,filecolor=OuterLinkColor,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/texinputs/sphinxhowto.cls new/Sphinx-1.1.3/sphinx/texinputs/sphinxhowto.cls
--- old/Sphinx-1.1.2/sphinx/texinputs/sphinxhowto.cls 2011-10-09 23:28:16.000000000 +0200
+++ new/Sphinx-1.1.3/sphinx/texinputs/sphinxhowto.cls 2012-01-29 10:11:30.000000000 +0100
@@ -79,3 +79,14 @@
\pagenumbering{arabic} % ToC & chapters
\thispagestyle{empty}
+
+% Fix the bibliography environment to add an entry to the Table of
+% Contents.
+% For an article document class this environment is a section,
+% so no page break before it.
+\let\py@OldThebibliography=\thebibliography
+\renewcommand{\thebibliography}[1]{
+ \phantomsection
+ \py@OldThebibliography{1}
+ \addcontentsline{toc}{section}{\bibname}
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/texinputs/sphinxmanual.cls new/Sphinx-1.1.3/sphinx/texinputs/sphinxmanual.cls
--- old/Sphinx-1.1.2/sphinx/texinputs/sphinxmanual.cls 2011-10-09 23:28:16.000000000 +0200
+++ new/Sphinx-1.1.3/sphinx/texinputs/sphinxmanual.cls 2012-01-29 10:11:30.000000000 +0100
@@ -120,3 +120,14 @@
%
\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.6em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{4.1em}{3.5em}}
+
+% Fix the bibliography environment to add an entry to the Table of
+% Contents.
+% For a report document class this environment is a chapter.
+\let\py@OldThebibliography=\thebibliography
+\renewcommand{\thebibliography}[1]{
+ \cleardoublepage
+ \phantomsection
+ \py@OldThebibliography{1}
+ \addcontentsline{toc}{chapter}{\bibname}
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/themes/basic/static/basic.css_t new/Sphinx-1.1.3/sphinx/themes/basic/static/basic.css_t
--- old/Sphinx-1.1.2/sphinx/themes/basic/static/basic.css_t 2011-11-01 08:38:44.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/themes/basic/static/basic.css_t 2012-01-29 09:49:37.000000000 +0100
@@ -79,11 +79,11 @@
font-size: 1em;
}
-div.sphinxsidebar input[type="text"] {
+div.sphinxsidebar #searchbox input[type="text"] {
width: 170px;
}
-div.sphinxsidebar input[type="submit"] {
+div.sphinxsidebar #searchbox input[type="submit"] {
width: 30px;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/util/__init__.py new/Sphinx-1.1.3/sphinx/util/__init__.py
--- old/Sphinx-1.1.2/sphinx/util/__init__.py 2011-11-01 08:38:44.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/util/__init__.py 2012-03-10 21:46:44.000000000 +0100
@@ -28,6 +28,7 @@
import sphinx
from sphinx.errors import PycodeError
+from sphinx.util.pycompat import bytes
# import other utilities; partly for backwards compatibility, so don't
# prune unused ones indiscriminately
@@ -310,7 +311,7 @@
def force_decode(string, encoding):
"""Forcibly get a unicode string out of a bytestring."""
- if isinstance(string, str):
+ if isinstance(string, bytes):
if encoding:
string = string.decode(encoding)
else:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/util/inspect.py new/Sphinx-1.1.3/sphinx/util/inspect.py
--- old/Sphinx-1.1.2/sphinx/util/inspect.py 2011-10-09 23:28:17.000000000 +0200
+++ new/Sphinx-1.1.3/sphinx/util/inspect.py 2012-02-19 11:54:47.000000000 +0100
@@ -15,6 +15,9 @@
# relatively import this module
inspect = __import__('inspect')
+from sphinx.util import force_decode
+from sphinx.util.pycompat import bytes
+
if sys.version_info >= (2, 5):
from functools import partial
@@ -87,4 +90,6 @@
s = repr(object)
except Exception:
raise ValueError
+ if isinstance(s, bytes):
+ return force_decode(s, None).replace('\n', ' ')
return s.replace('\n', ' ')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/util/nodes.py new/Sphinx-1.1.3/sphinx/util/nodes.py
--- old/Sphinx-1.1.2/sphinx/util/nodes.py 2011-11-01 08:38:44.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/util/nodes.py 2012-02-19 11:54:47.000000000 +0100
@@ -179,8 +179,12 @@
directive.state_machine.get_source_and_line(directive.lineno)
def set_role_source_info(inliner, lineno, node):
+ try:
node.source, node.line = \
inliner.reporter.locator(lineno)
+ except AttributeError:
+ # docutils 0.9+
+ node.source, node.line = inliner.reporter.get_source_and_line(lineno)
# monkey-patch Node.__contains__ to get consistent "in" operator behavior
# across docutils versions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/util/osutil.py new/Sphinx-1.1.3/sphinx/util/osutil.py
--- old/Sphinx-1.1.2/sphinx/util/osutil.py 2011-11-01 08:38:44.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/util/osutil.py 2012-01-29 10:09:18.000000000 +0100
@@ -142,4 +142,9 @@
return path
def find_catalog(docname, compaction):
- return docname.split(SEP, 1)[0] if compaction else docname
+ if compaction:
+ ret = docname.split(SEP, 1)[0]
+ else:
+ ret = docname
+
+ return ret
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/util/pycompat.py new/Sphinx-1.1.3/sphinx/util/pycompat.py
--- old/Sphinx-1.1.2/sphinx/util/pycompat.py 2011-11-01 08:38:44.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/util/pycompat.py 2012-02-19 11:54:47.000000000 +0100
@@ -64,6 +64,11 @@
return s.encode('ascii', 'backslashreplace')
+try:
+ from html import escape as htmlescape
+except ImportError:
+ from cgi import escape as htmlescape
+
# ------------------------------------------------------------------------------
# Missing builtins and itertools in Python < 2.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/websupport/__init__.py new/Sphinx-1.1.3/sphinx/websupport/__init__.py
--- old/Sphinx-1.1.2/sphinx/websupport/__init__.py 2011-11-01 15:41:08.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/websupport/__init__.py 2012-02-19 11:54:47.000000000 +0100
@@ -9,7 +9,6 @@
:license: BSD, see LICENSE for details.
"""
-import cgi
import sys
import cPickle as pickle
import posixpath
@@ -22,6 +21,7 @@
from sphinx.application import Sphinx
from sphinx.util.osutil import ensuredir
from sphinx.util.jsonimpl import dumps as dump_json
+from sphinx.util.pycompat import htmlescape
from sphinx.websupport import errors
from sphinx.websupport.search import BaseSearch, SEARCH_ADAPTERS
from sphinx.websupport.storage import StorageBackend
@@ -452,5 +452,5 @@
ret = publish_parts(text, writer_name='html',
settings_overrides=settings)['fragment']
except Exception:
- ret = cgi.escape(text)
+ ret = htmlescape(text)
return ret
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/websupport/storage/differ.py new/Sphinx-1.1.3/sphinx/websupport/storage/differ.py
--- old/Sphinx-1.1.2/sphinx/websupport/storage/differ.py 2011-10-09 23:28:17.000000000 +0200
+++ new/Sphinx-1.1.3/sphinx/websupport/storage/differ.py 2012-02-19 11:54:47.000000000 +0100
@@ -10,9 +10,10 @@
"""
import re
-from cgi import escape
from difflib import Differ
+from sphinx.util.pycompat import htmlescape
+
class CombinedHtmlDiff(object):
"""Create an HTML representation of the differences between two pieces
@@ -21,7 +22,7 @@
highlight_regex = re.compile(r'([\+\-\^]+)')
def __init__(self, source, proposal):
- proposal = escape(proposal)
+ proposal = htmlescape(proposal)
differ = Differ()
self.diff = list(differ.compare(source.splitlines(1),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/websupport/storage/sqlalchemy_db.py new/Sphinx-1.1.3/sphinx/websupport/storage/sqlalchemy_db.py
--- old/Sphinx-1.1.2/sphinx/websupport/storage/sqlalchemy_db.py 2011-10-09 23:28:17.000000000 +0200
+++ new/Sphinx-1.1.3/sphinx/websupport/storage/sqlalchemy_db.py 2012-01-29 10:09:18.000000000 +0100
@@ -77,7 +77,10 @@
comments = []
list_stack = [comments]
for r in results:
- comment, vote = r if username else (r, 0)
+ if username:
+ comment, vote = r
+ else:
+ comment, vote = (r, 0)
inheritance_chain = comment.path.split('.')[1:]
@@ -176,7 +179,10 @@
path = self.path.split('.')
node = path[0]
- parent = path[-2] if len(path) > 2 else None
+ if len(path) > 2:
+ parent = path[-2]
+ else:
+ parent = None
return {'text': self.text,
'username': self.username or 'Anonymous',
@@ -201,8 +207,16 @@
minutes = seconds / 60
if days == 0:
- dt = (minutes, 'minute') if hours == 0 else (hours, 'hour')
+ if hours == 0:
+ dt = (minutes, 'minute')
+ else:
+ dt = (hours, 'hour')
else:
dt = (days, 'day')
- return '%s %s ago' % dt if dt[0] == 1 else '%s %ss ago' % dt
+ if dt[0] == 1:
+ ret = '%s %s ago' % dt
+ else:
+ ret = '%s %ss ago' % dt
+
+ return ret
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/writers/html.py new/Sphinx-1.1.3/sphinx/writers/html.py
--- old/Sphinx-1.1.2/sphinx/writers/html.py 2011-11-01 08:38:44.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/writers/html.py 2012-03-10 21:38:03.000000000 +0100
@@ -65,6 +65,8 @@
self.permalink_text = self.permalink_text and u'\u00B6' or ''
self.permalink_text = self.encode(self.permalink_text)
self.secnumber_suffix = builder.config.html_secnumber_suffix
+ self.param_separator = ''
+ self._table_row_index = 0
def visit_start_of_file(self, node):
# only occurs in the single-file builder
@@ -233,12 +235,13 @@
lang = self.highlightlang
linenos = node.rawsource.count('\n') >= \
self.highlightlinenothreshold - 1
+ highlight_args = node.get('highlight_args', {})
if node.has_key('language'):
# code-block directives
lang = node['language']
+ highlight_args['force'] = True
if node.has_key('linenos'):
linenos = node['linenos']
- highlight_args = node.get('highlight_args', {})
def warner(msg):
self.builder.warn(msg, (self.builder.current_docname, node.line))
highlighted = self.highlighter.highlight_block(
@@ -355,6 +358,9 @@
return
if node.has_key('scale'):
+ # Try to figure out image height and width. Docutils does that too,
+ # but it tries the final file name, which does not necessarily exist
+ # yet at the time the HTML file is written.
if Image and not (node.has_key('width')
and node.has_key('height')):
try:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/sphinx/writers/latex.py new/Sphinx-1.1.3/sphinx/writers/latex.py
--- old/Sphinx-1.1.2/sphinx/writers/latex.py 2011-11-01 15:13:30.000000000 +0100
+++ new/Sphinx-1.1.3/sphinx/writers/latex.py 2012-02-19 11:54:47.000000000 +0100
@@ -1299,12 +1299,13 @@
code = self.verbatim.rstrip('\n')
lang = self.hlsettingstack[-1][0]
linenos = code.count('\n') >= self.hlsettingstack[-1][1] - 1
+ highlight_args = node.get('highlight_args', {})
if 'language' in node:
# code-block directives
lang = node['language']
+ highlight_args['force'] = True
if 'linenos' in node:
linenos = node['linenos']
- highlight_args = node.get('highlight_args', {})
def warner(msg):
self.builder.warn(msg, (self.curfilestack[-1], node.line))
hlcode = self.highlighter.highlight_block(code, lang, warn=warner,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/tests/run.py new/Sphinx-1.1.3/tests/run.py
--- old/Sphinx-1.1.2/tests/run.py 2011-10-09 23:28:17.000000000 +0200
+++ new/Sphinx-1.1.3/tests/run.py 2012-03-10 18:57:39.000000000 +0100
@@ -22,9 +22,11 @@
copydir_run_2to3(testroot, newroot)
# switch to the converted dir so nose tests the right tests
chdir(newroot)
-
-# always test the sphinx package from this directory
-sys.path.insert(0, path.join(path.dirname(__file__), path.pardir))
+ # always test the sphinx package from build/lib/
+ sys.path.insert(0, path.pardir)
+else:
+ # always test the sphinx package from this directory
+ sys.path.insert(0, path.join(path.dirname(__file__), path.pardir))
try:
import nose
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/tests/test_build_html.py new/Sphinx-1.1.3/tests/test_build_html.py
--- old/Sphinx-1.1.2/tests/test_build_html.py 2011-11-01 08:38:44.000000000 +0100
+++ new/Sphinx-1.1.3/tests/test_build_html.py 2012-02-19 11:54:47.000000000 +0100
@@ -258,7 +258,7 @@
r'def'),
(".//div[@class='inc-tab3 highlight-text']//pre",
r'-| |-'),
- (".//div[@class='inc-tab8 highlight-python']//pre",
+ (".//div[@class='inc-tab8 highlight-python']//pre/span",
r'-| |-'),
])
HTML_XPATH['subdir/includes.html'].extend([
@@ -328,7 +328,11 @@
for fname, paths in HTML_XPATH.iteritems():
parser = NslessParser()
parser.entity.update(htmlentitydefs.entitydefs)
- etree = ET.parse(os.path.join(app.outdir, fname), parser)
+ fp = open(os.path.join(app.outdir, fname))
+ try:
+ etree = ET.parse(fp, parser)
+ finally:
+ fp.close()
for path, check in paths:
yield check_xpath, etree, fname, path, check
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/tests/test_intersphinx.py new/Sphinx-1.1.3/tests/test_intersphinx.py
--- old/Sphinx-1.1.2/tests/test_intersphinx.py 2011-11-01 08:38:44.000000000 +0100
+++ new/Sphinx-1.1.3/tests/test_intersphinx.py 2012-03-10 18:57:10.000000000 +0100
@@ -43,6 +43,7 @@
module2 py:module 0 foo.html#module-$ -
module1.func py:function 1 sub/foo.html#$ -
CFunc c:function 2 cfunc.html#CFunc -
+a term std:term -1 glossary.html#term-a-term -
'''.encode('utf-8'))
@@ -76,6 +77,8 @@
assert invdata1['py:function']['module1.func'][2] == \
'/util/sub/foo.html#module1.func'
assert invdata1['c:function']['CFunc'][2] == '/util/cfunc.html#CFunc'
+ assert invdata1['std:term']['a term'][2] == \
+ '/util/glossary.html#term-a-term'
@with_app(confoverrides={'extensions': 'sphinx.ext.intersphinx'})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.1.2/tests/test_quickstart.py new/Sphinx-1.1.3/tests/test_quickstart.py
--- old/Sphinx-1.1.2/tests/test_quickstart.py 2011-11-01 08:38:44.000000000 +0100
+++ new/Sphinx-1.1.3/tests/test_quickstart.py 2012-03-10 18:57:39.000000000 +0100
@@ -91,7 +91,7 @@
conffile = tempdir / 'conf.py'
assert conffile.isfile()
ns = {}
- f = open(conffile, 'U')
+ f = open(conffile, 'rbU')
try:
code = compile(f.read(), conffile, 'exec')
finally:
@@ -151,7 +151,7 @@
conffile = tempdir / 'source' / 'conf.py'
assert conffile.isfile()
ns = {}
- f = open(conffile, 'U')
+ f = open(conffile, 'rbU')
try:
code = compile(f.read(), conffile, 'exec')
finally:
++++++ python3-Sphinx-docs.patch ++++++
diff -ruN ./sphinx/domains/cpp.py ../Sphinx-1.1.3.p3k/sphinx/domains/cpp.py
--- ./sphinx/domains/cpp.py 2012-01-29 17:49:09.000000000 +0900
+++ ../Sphinx-1.1.3.p3k/sphinx/domains/cpp.py 2012-05-24 00:41:06.524526456 +0900
@@ -162,7 +162,7 @@
raise NotImplementedError()
def __str__(self):
- return unicode(self).encode('utf-8')
+ return self.__unicode__()
def __unicode__(self):
raise NotImplementedError()
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org