[Python-modules-commits] [sphinx] 01/06: Import sphinx_1.4.5.orig.tar.gz

Dmitry Shachnev mitya57 at moszumanska.debian.org
Wed Jul 13 20:14:16 UTC 2016


This is an automated email from the git hooks/post-receive script.

mitya57 pushed a commit to branch master
in repository sphinx.

commit ac9e2c8ed1e74a0de1b53839c66ba4898e86b7a4
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date:   Wed Jul 13 22:51:57 2016 +0300

    Import sphinx_1.4.5.orig.tar.gz
---
 CHANGES                                    |  73 +++++-
 PKG-INFO                                   |   2 +-
 README.rst                                 |   6 +
 Sphinx.egg-info/PKG-INFO                   |   2 +-
 Sphinx.egg-info/SOURCES.txt                |   6 +
 doc/config.rst                             |  15 ++
 doc/install.rst                            |   2 +-
 sphinx/__init__.py                         |   6 +-
 sphinx/application.py                      |   7 +-
 sphinx/builders/applehelp.py               |   1 +
 sphinx/builders/devhelp.py                 |   1 +
 sphinx/builders/epub.py                    |   1 +
 sphinx/builders/gettext.py                 |   2 +-
 sphinx/builders/htmlhelp.py                |  20 +-
 sphinx/builders/qthelp.py                  |   1 +
 sphinx/config.py                           |   1 +
 sphinx/domains/c.py                        |   3 +
 sphinx/domains/cpp.py                      |  53 ++---
 sphinx/environment.py                      |  17 +-
 sphinx/ext/intersphinx.py                  |  13 +-
 sphinx/ext/viewcode.py                     |   4 +-
 sphinx/pycode/Grammar-py2-sphinx1.5.pickle | Bin 0 -> 18705 bytes
 sphinx/pycode/Grammar-py2.pickle           | Bin 0 -> 18705 bytes
 sphinx/pycode/Grammar-py3-sphinx1.5.pickle | Bin 0 -> 19546 bytes
 sphinx/pycode/Grammar-py3.pickle           | Bin 0 -> 19546 bytes
 sphinx/quickstart.py                       |   6 +
 sphinx/texinputs/sphinx.sty                | 355 ++++++++++++++++-------------
 sphinx/texinputs/sphinxhowto.cls           |  10 +-
 sphinx/texinputs/sphinxmanual.cls          |  10 +-
 sphinx/util/inspect.py                     |   4 +
 sphinx/util/jsdump.py                      |   2 +-
 sphinx/writers/html.py                     |   9 +-
 sphinx/writers/latex.py                    | 133 +++++------
 tests/.test_build_latex.py.swp             | Bin 0 -> 53248 bytes
 tests/test_build_latex.py                  |  59 ++---
 tests/test_directive_code.py               |  24 +-
 tests/test_domain_cpp.py                   |   5 +
 tests/test_ext_intersphinx.py              |   3 +
 tests/test_markup.py                       |  14 +-
 tests/test_util_jsdump.py                  |   9 +
 40 files changed, 536 insertions(+), 343 deletions(-)

diff --git a/CHANGES b/CHANGES
index 25b6282..531d7c3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,55 @@
+Release 1.4.5 (released Jul 13, 2016)
+=====================================
+
+Incompatible changes
+--------------------
+
+* latex, inclusion of non-inline images from image directive resulted in
+  non-coherent whitespaces depending on original image width; new behaviour
+  by necessity differs from earlier one in some cases. (ref: #2672)
+* latex, use of ``\includegraphics`` to refer to Sphinx custom variant is
+  deprecated; in future it will revert to original LaTeX macro, custom one
+  already has alternative name ``\sphinxincludegraphics``.
+
+Features added
+--------------
+
+* new config option ``latex_keep_old_macro_names``, defaults to True. If False,
+  lets macros (for text styling) be defined only with ``\sphinx``-prefixed names.
+* latex writer allows user customization of "shadowed" boxes (topics), via
+  three length variables.
+* woff-format web font files now supported by the epub builder.
+
+Bugs fixed
+----------
+
+* jsdump fix for python 3: fixes the HTML search on python > 3
+* #2676: (latex) Error with verbatim text in captions since Sphinx 1.4.4
+* #2629: memoir class crashes LaTeX. Fixed ``by latex_keep_old_macro_names=False`` (ref 2675)
+* #2684: `sphinx.ext.intersphinx` crashes with six-1.4.1
+* #2679: ``float`` package needed for ``'figure_align': 'H'`` latex option
+* #2671: image directive may lead to inconsistent spacing in pdf
+* #2705: ``toctree`` generates empty bullet_list if ``:titlesonly:`` specified
+* #2479: `sphinx.ext.viewcode` uses python2 highlighter by default
+* #2700: HtmlHelp builder has hard coded index.html
+* latex, since 1.4.4 inline literal text is followed by spurious space
+* #2722: C++, fix id generation for var/member declarations to include namespaces.
+* latex, images (from image directive) in lists or quoted blocks did not obey
+  indentation (fixed together with #2671)
+* #2733: since Sphinx-1.4.4 ``make latexpdf`` generates lots of hyperref warnings
+* #2731: `sphinx.ext.autodoc` does not access propertymethods which raises any
+  exceptions
+* #2666: C++, properly look up nested names involving constructors.
+* #2579: Could not refer a label including both spaces and colons via
+  `sphinx.ext.intersphinx`
+* #2718: Sphinx crashes if the document file is not readable
+* #2699: hyperlinks in help HTMLs are broken if `html_file_suffix` is set
+* #2723: extra spaces in latex pdf output from multirow cell
+* #2735: latexpdf ``Underfull \hbox (badness 10000)`` warnings from title page
+* #2667: latex crashes if resized images appeared in section title
+* #2763: (html) Provide default value for required ``alt`` attribute for image
+  tags of SVG source, required to validate and now consistent w/ other formats.
+
 Release 1.4.4 (released Jun 12, 2016)
 =====================================
 
@@ -14,8 +66,10 @@ Bugs fixed
 * #2351: latex crashes if enumerated lists are placed on footnotes
 * #2646: latex crashes if math contains twice empty lines
 * #2480: `sphinx.ext.autodoc`: memory addresses were shown
-* latex: allow code-blocks appearing inside lists and quotes at maximal nesting depth (ref #777, #2624, #2651)
-* #2635: Latex code directives produce inconsistent frames based on viewing resolution
+* latex: allow code-blocks appearing inside lists and quotes at maximal nesting
+  depth (ref #777, #2624, #2651)
+* #2635: Latex code directives produce inconsistent frames based on viewing
+  resolution
 * #2639: Sphinx now bundles iftex.sty
 * Failed to build PDF with framed.sty 0.95
 * Sphinx now bundles needspace.sty
@@ -27,15 +81,18 @@ Release 1.4.3 (released Jun 5, 2016)
 Bugs fixed
 ----------
 
-* #2530: got "Counter too large" error on building PDF if large numbered footnotes existed in admonitions
+* #2530: got "Counter too large" error on building PDF if large numbered
+  footnotes existed in admonitions
 * ``width`` option of figure directive does not work if ``align`` option specified at same time (ref: #2595)
 * #2590: The ``inputenc`` package breaks compiling under lualatex and xelatex
 * #2540: date on latex front page use different font
 * Suppress "document isn't included in any toctree" warning if the document is included (ref: #2603)
-* #2614: Some tables in PDF output will end up shifted if user sets non zero \parindent in preamble
+* #2614: Some tables in PDF output will end up shifted if user sets non zero
+  \parindent in preamble
 * #2602: URL redirection breaks the hyperlinks generated by `sphinx.ext.intersphinx`
 * #2613: Show warnings if merged extensions are loaded
-* #2619: make sure amstext LaTeX package always loaded (ref: d657225, 488ee52, 9d82cad and #2615)
+* #2619: make sure amstext LaTeX package always loaded (ref: d657225, 488ee52,
+  9d82cad and #2615)
 * #2593: latex crashes if any figures in the table
 
 
@@ -76,7 +133,8 @@ Bugs fixed
 * #2397: Setup shorthandoff for turkish documents
 * #2447: VerbatimBorderColor wrongly used also for captions of PDF
 * #2456: C++, fix crash related to document merging (e.g., singlehtml and Latex builders).
-* #2446: latex(pdf) sets local tables of contents (or more generally topic nodes) in unbreakable boxes, causes overflow at bottom
+* #2446: latex(pdf) sets local tables of contents (or more generally topic
+  nodes) in unbreakable boxes, causes overflow at bottom
 * #2476: Omit MathJax markers if :nowrap: is given
 * #2465: latex builder fails in case no caption option is provided to toctree directive
 * Sphinx crashes if self referenced toctree found
@@ -285,7 +343,8 @@ Bugs fixed
   is highlighted as Python 3 (which is mostly a superset of Python 2) if possible.
   To get the old behavior back, add ``highlight_language = "python"`` to conf.py.
 * #2329: Refresh environment forcely if source directory has changed.
-* #2331: Fix code-blocks are filled by block in dvi; remove ``xcdraw`` option from xcolor package
+* #2331: Fix code-blocks are filled by block in dvi; remove ``xcdraw`` option from
+  xcolor package
 * Fix the confval type checker emits warnings if unicode is given to confvals which expects string value
 * #2360: Fix numref in LaTeX output is broken
 * #2361: Fix additional paragraphs inside the "compound" directive are indented
diff --git a/PKG-INFO b/PKG-INFO
index 2f4d2df..22132c5 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: Sphinx
-Version: 1.4.4
+Version: 1.4.5
 Summary: Python documentation generator
 Home-page: http://sphinx-doc.org/
 Author: Georg Brandl
diff --git a/README.rst b/README.rst
index 391d0bd..384e2cc 100644
--- a/README.rst
+++ b/README.rst
@@ -33,6 +33,12 @@ Install from cloned source as editable::
    pip install -e .
 
 
+Release signatures
+==================
+
+Releases are signed with `498D6B9E <https://pgp.mit.edu/pks/lookup?op=vindex&search=0x102C2C17498D6B9E>`_
+
+
 Reading the docs
 ================
 
diff --git a/Sphinx.egg-info/PKG-INFO b/Sphinx.egg-info/PKG-INFO
index 2f4d2df..22132c5 100644
--- a/Sphinx.egg-info/PKG-INFO
+++ b/Sphinx.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: Sphinx
-Version: 1.4.4
+Version: 1.4.5
 Summary: Python documentation generator
 Home-page: http://sphinx-doc.org/
 Author: Georg Brandl
diff --git a/Sphinx.egg-info/SOURCES.txt b/Sphinx.egg-info/SOURCES.txt
index f4e6661..66ef5db 100644
--- a/Sphinx.egg-info/SOURCES.txt
+++ b/Sphinx.egg-info/SOURCES.txt
@@ -331,7 +331,11 @@ sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po
 sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js
 sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo
 sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po
+sphinx/pycode/Grammar-py2-sphinx1.5.pickle
+sphinx/pycode/Grammar-py2.pickle
 sphinx/pycode/Grammar-py2.txt
+sphinx/pycode/Grammar-py3-sphinx1.5.pickle
+sphinx/pycode/Grammar-py3.pickle
 sphinx/pycode/Grammar-py3.txt
 sphinx/pycode/__init__.py
 sphinx/pycode/nodes.py
@@ -529,6 +533,7 @@ sphinx/writers/texinfo.py
 sphinx/writers/text.py
 sphinx/writers/websupport.py
 sphinx/writers/xml.py
+tests/.test_build_latex.py.swp
 tests/coverage.py
 tests/path.py
 tests/run.py
@@ -584,6 +589,7 @@ tests/test_theming.py
 tests/test_toctree.py
 tests/test_util.py
 tests/test_util_i18n.py
+tests/test_util_jsdump.py
 tests/test_util_logging.py
 tests/test_util_nodes.py
 tests/test_versioning.py
diff --git a/doc/config.rst b/doc/config.rst
index b45f9df..b579d7e 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -1565,6 +1565,21 @@ These options influence LaTeX output.
       value selected the ``'inline'`` display.  For backwards compatibility,
       ``True`` is still accepted.
 
+.. confval:: latex_keep_old_macro_names
+
+   If ``True`` (default) the ``\strong``, ``\code``, ``\bfcode``, ``\email``,
+   ``\tablecontinued``, ``\titleref``, ``\menuselection``, ``\accelerator``,
+   ``\crossref``, ``\termref``, and ``\optional`` text styling macros are
+   pre-defined by Sphinx and may be user-customized by some
+   ``\renewcommand``'s inserted either via ``'preamble'`` key or :dudir:`raw
+   <raw-data-pass-through>` directive. If ``False``, only ``\sphinxstrong``,
+   etc... macros are defined (and may be redefined by user). Setting to
+   ``False`` may help solve macro name conflicts caused by user-added latex
+   packages.
+
+   .. versionadded:: 1.4.5
+
+
 .. confval:: latex_elements
 
    .. versionadded:: 0.5
diff --git a/doc/install.rst b/doc/install.rst
index 0ecd736..a2aeaf9 100644
--- a/doc/install.rst
+++ b/doc/install.rst
@@ -135,7 +135,7 @@ install.
 .. note::
 
    ``pip`` has been contained in the Python official installation after version
-    of Python-3.4.0 or Python-2.7.9.
+   of Python-3.4.0 or Python-2.7.9.
 
 
 Installing Sphinx with pip
diff --git a/sphinx/__init__.py b/sphinx/__init__.py
index 252f24e..ae5c11f 100644
--- a/sphinx/__init__.py
+++ b/sphinx/__init__.py
@@ -15,13 +15,13 @@
 import sys
 from os import path
 
-__version__  = '1.4.4'
-__released__ = '1.4.4'  # used when Sphinx builds its own docs
+__version__  = '1.4.5'
+__released__ = '1.4.5'  # used when Sphinx builds its own docs
 
 # version info for better programmatic use
 # possible values for 3rd element: 'alpha', 'beta', 'rc', 'final'
 # 'final' has 0 as the last element
-version_info = (1, 4, 4, 'final', 0)
+version_info = (1, 4, 5, 'final', 0)
 
 package_dir = path.abspath(path.dirname(__file__))
 
diff --git a/sphinx/application.py b/sphinx/application.py
index 6bb35a0..5fa0182 100644
--- a/sphinx/application.py
+++ b/sphinx/application.py
@@ -239,8 +239,8 @@ class Sphinx(object):
 
     def _init_env(self, freshenv):
         if freshenv:
-            self.env = BuildEnvironment(self.srcdir, self.doctreedir,
-                                        self.config)
+            self.env = BuildEnvironment(self.srcdir, self.doctreedir, self.config)
+            self.env.set_warnfunc(self.warn)
             self.env.find_files(self.config)
             for domain in self.domains.keys():
                 self.env.domains[domain] = self.domains[domain](self.env)
@@ -249,6 +249,7 @@ class Sphinx(object):
                 self.info(bold('loading pickled environment... '), nonl=True)
                 self.env = BuildEnvironment.frompickle(
                     self.srcdir, self.config, path.join(self.doctreedir, ENV_PICKLE_FILENAME))
+                self.env.set_warnfunc(self.warn)
                 self.env.domains = {}
                 for domain in self.domains.keys():
                     # this can raise if the data version doesn't fit
@@ -261,8 +262,6 @@ class Sphinx(object):
                     self.info('failed: %s' % err)
                 return self._init_env(freshenv=True)
 
-        self.env.set_warnfunc(self.warn)
-
     def _init_builder(self, buildername):
         if buildername is None:
             print('No builder selected, using default: html', file=self._status)
diff --git a/sphinx/builders/applehelp.py b/sphinx/builders/applehelp.py
index 53a0c99..ee5c1ad 100644
--- a/sphinx/builders/applehelp.py
+++ b/sphinx/builders/applehelp.py
@@ -84,6 +84,7 @@ class AppleHelpBuilder(StandaloneHTMLBuilder):
         super(AppleHelpBuilder, self).init()
         # the output files for HTML help must be .html only
         self.out_suffix = '.html'
+        self.link_suffix = '.html'
 
         if self.config.applehelp_bundle_id is None:
             raise SphinxError('You must set applehelp_bundle_id before '
diff --git a/sphinx/builders/devhelp.py b/sphinx/builders/devhelp.py
index 62e2c98..5239411 100644
--- a/sphinx/builders/devhelp.py
+++ b/sphinx/builders/devhelp.py
@@ -59,6 +59,7 @@ class DevhelpBuilder(StandaloneHTMLBuilder):
     def init(self):
         StandaloneHTMLBuilder.init(self)
         self.out_suffix = '.html'
+        self.link_suffix = '.html'
 
     def handle_finish(self):
         self.build_devhelp(self.outdir, self.config.devhelp_basename)
diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py
index cc839d7..faa587a 100644
--- a/sphinx/builders/epub.py
+++ b/sphinx/builders/epub.py
@@ -152,6 +152,7 @@ MEDIA_TYPES = {
     '.jpeg': 'image/jpeg',
     '.otf': 'application/x-font-otf',
     '.ttf': 'application/x-font-ttf',
+    '.woff': 'application/font-woff',
 }
 
 VECTOR_GRAPHICS_EXTENSIONS = ('.svg',)
diff --git a/sphinx/builders/gettext.py b/sphinx/builders/gettext.py
index 1c47893..a7fea86 100644
--- a/sphinx/builders/gettext.py
+++ b/sphinx/builders/gettext.py
@@ -135,7 +135,7 @@ tzdelta = datetime.fromtimestamp(timestamp) - \
 source_date_epoch = getenv('SOURCE_DATE_EPOCH')
 if source_date_epoch is not None:
     timestamp = float(source_date_epoch)
-    tzdelta = 0
+    tzdelta = timedelta(0)
 
 
 class LocalTimeZone(tzinfo):
diff --git a/sphinx/builders/htmlhelp.py b/sphinx/builders/htmlhelp.py
index f4003c4..f162632 100644
--- a/sphinx/builders/htmlhelp.py
+++ b/sphinx/builders/htmlhelp.py
@@ -63,7 +63,7 @@ Binary Index=No
 Compiled file=%(outname)s.chm
 Contents file=%(outname)s.hhc
 Default Window=%(outname)s
-Default topic=index.html
+Default topic=%(master_doc)s
 Display compile progress=No
 Full text search stop list file=%(outname)s.stp
 Full-text search=Yes
@@ -73,7 +73,7 @@ Title=%(title)s
 
 [WINDOWS]
 %(outname)s="%(title)s","%(outname)s.hhc","%(outname)s.hhk",\
-"index.html","index.html",,,,,0x63520,220,0x10384e,[0,0,1024,768],,,,,,,0
+"%(master_doc)s","%(master_doc)s",,,,,0x63520,220,0x10384e,[0,0,1024,768],,,,,,,0
 
 [FILES]
 '''
@@ -183,6 +183,7 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
         StandaloneHTMLBuilder.init(self)
         # the output files for HTML help must be .html only
         self.out_suffix = '.html'
+        self.link_suffix = '.html'
         # determine the correct locale setting
         locale = chm_locales.get(self.config.language)
         if locale is not None:
@@ -208,11 +209,14 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
         self.info('writing project file...')
         f = self.open_file(outdir, outname+'.hhp')
         try:
-            f.write(project_template % {'outname': outname,
-                                        'title': self.config.html_title,
-                                        'version': self.config.version,
-                                        'project': self.config.project,
-                                        'lcid': self.lcid})
+            f.write(project_template % {
+                'outname': outname,
+                'title': self.config.html_title,
+                'version': self.config.version,
+                'project': self.config.project,
+                'lcid': self.lcid,
+                'master_doc': self.config.master_doc + self.out_suffix
+            })
             if not outdir.endswith(os.sep):
                 outdir += os.sep
             olen = len(outdir)
@@ -232,7 +236,7 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
             f.write(contents_header)
             # special books
             f.write('<LI> ' + object_sitemap % (self.config.html_short_title,
-                                                'index.html'))
+                                                self.config.master_doc + self.out_suffix))
             for indexname, indexcls, content, collapse in self.domain_indices:
                 f.write('<LI> ' + object_sitemap % (indexcls.localname,
                                                     '%s.html' % indexname))
diff --git a/sphinx/builders/qthelp.py b/sphinx/builders/qthelp.py
index 0a7e85c..e02985b 100644
--- a/sphinx/builders/qthelp.py
+++ b/sphinx/builders/qthelp.py
@@ -111,6 +111,7 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
         StandaloneHTMLBuilder.init(self)
         # the output files for HTML help must be .html only
         self.out_suffix = '.html'
+        self.link_suffix = '.html'
         # self.config.html_style = 'traditional.css'
 
     def handle_finish(self):
diff --git a/sphinx/config.py b/sphinx/config.py
index 9cbf655..9527d9a 100644
--- a/sphinx/config.py
+++ b/sphinx/config.py
@@ -209,6 +209,7 @@ class Config(object):
                            None),
         latex_logo = (None, None, string_classes),
         latex_appendices = ([], None),
+        latex_keep_old_macro_names = (True, None),
         # now deprecated - use latex_toplevel_sectioning
         latex_use_parts = (False, None),
         latex_toplevel_sectioning = (None, None, [str]),
diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py
index c7fd068..8ba159d 100644
--- a/sphinx/domains/c.py
+++ b/sphinx/domains/c.py
@@ -279,6 +279,9 @@ class CDomain(Domain):
                      typ, target, node, contnode):
         # strip pointer asterisk
         target = target.rstrip(' *')
+        # becase TypedField can generate xrefs
+        if target in CObject.stopwords:
+            return contnode
         if target not in self.data['objects']:
             return None
         obj = self.data['objects'][target]
diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py
index 7d41d65..3239052 100644
--- a/sphinx/domains/cpp.py
+++ b/sphinx/domains/cpp.py
@@ -1977,7 +1977,7 @@ class ASTTypeWithInit(ASTBase):
 
     def get_id_v2(self, objectType=None, symbol=None):
         if objectType == 'member':
-            return symbol.declaration.name.get_id_v2()
+            return symbol.get_full_nested_name().get_id_v2()
         else:
             return self.type.get_id_v2()
 
@@ -2660,6 +2660,10 @@ class Symbol(object):
                 if symbol is None:
                     # TODO: maybe search without template args
                     return None
+                # We have now matched part of a nested name, and need to match more
+                # so even if we should matchSelf before, we definitely shouldn't
+                # even more. (see also issue #2666)
+                matchSelf = False
             parentSymbol = symbol
         assert False  # should have returned in the loop
 
@@ -3007,10 +3011,9 @@ class DefinitionParser(object):
                         self.fail('Expected ")" after "..." in '
                                   'parameters_and_qualifiers.')
                     break
-                if paramMode == 'function':
-                    arg = self._parse_type_with_init(outer=None, named='single')
-                else:
-                    arg = self._parse_type(named=False)
+                # note: it seems that function arguments can always sbe named,
+                # even in function pointers and similar.
+                arg = self._parse_type_with_init(outer=None, named='single')
                 # TODO: parse default parameters # TODO: didn't we just do that?
                 args.append(ASTFunctinoParameter(arg))
 
@@ -3734,7 +3737,7 @@ class CPPObject(ObjectDescription):
             id_v1 = None
         id_v2 = ast.get_id_v2()
         # store them in reverse order, so the newest is first
-        ids  = [id_v2, id_v1]
+        ids = [id_v2, id_v1]
 
         newestId = ids[0]
         assert newestId  # shouldn't be None
@@ -3755,8 +3758,14 @@ class CPPObject(ObjectDescription):
             else:
                 # print("[CPP] non-unique name:", name)
                 pass
-            for id in ids:
-                if id:  # is None when the element didn't exist in that version
+            # always add the newest id
+            assert newestId
+            signode['ids'].append(newestId)
+            # only add compatibility ids when there are no conflicts
+            for id in ids[1:]:
+                if not id:  # is None when the element didn't exist in that version
+                    continue
+                if id not in self.state.document.ids:
                     signode['ids'].append(id)
             signode['first'] = (not self.names)  # hmm, what is this abound?
             self.state.document.note_explicit_target(signode)
@@ -3800,6 +3809,15 @@ class CPPObject(ObjectDescription):
         self.describe_signature(signode, ast)
         return ast
 
+    def before_content(self):
+        lastSymbol = self.env.ref_context['cpp:last_symbol']
+        assert lastSymbol
+        self.oldParentSymbol = self.env.ref_context['cpp:parent_symbol']
+        self.env.ref_context['cpp:parent_symbol'] = lastSymbol
+
+    def after_content(self):
+        self.env.ref_context['cpp:parent_symbol'] = self.oldParentSymbol
+
 
 class CPPTypeObject(CPPObject):
     def get_index_text(self, name):
@@ -3838,15 +3856,6 @@ class CPPClassObject(CPPObject):
     def get_index_text(self, name):
         return _('%s (C++ class)') % name
 
-    def before_content(self):
-        lastSymbol = self.env.ref_context['cpp:last_symbol']
-        assert lastSymbol
-        self.oldParentSymbol = self.env.ref_context['cpp:parent_symbol']
-        self.env.ref_context['cpp:parent_symbol'] = lastSymbol
-
-    def after_content(self):
-        self.env.ref_context['cpp:parent_symbol'] = self.oldParentSymbol
-
     def parse_definition(self, parser):
         return parser.parse_declaration("class")
 
@@ -3858,15 +3867,6 @@ class CPPEnumObject(CPPObject):
     def get_index_text(self, name):
         return _('%s (C++ enum)') % name
 
-    def before_content(self):
-        lastSymbol = self.env.ref_context['cpp:last_symbol']
-        assert lastSymbol
-        self.oldParentSymbol = self.env.ref_context['cpp:parent_symbol']
-        self.env.ref_context['cpp:parent_symbol'] = lastSymbol
-
-    def after_content(self):
-        self.env.ref_context['cpp:parent_symbol'] = self.oldParentSymbol
-
     def parse_definition(self, parser):
         ast = parser.parse_declaration("enum")
         # self.objtype is set by ObjectDescription in run()
@@ -4123,6 +4123,7 @@ class CPPDomain(Domain):
                                    matchSelf=True)
         if s is None or s.declaration is None:
             return None, None
+
         declaration = s.declaration
         fullNestedName = s.get_full_nested_name()
         name = text_type(fullNestedName).lstrip(':')
diff --git a/sphinx/environment.py b/sphinx/environment.py
index 9d4c174..e71d8c5 100644
--- a/sphinx/environment.py
+++ b/sphinx/environment.py
@@ -409,8 +409,13 @@ class BuildEnvironment:
             config.html_extra_path +
             ['**/_sources', '.#*', '**/.#*', '*.lproj/**']
         )
-        self.found_docs = set(get_matching_docs(
-            self.srcdir, config.source_suffix, exclude_matchers=matchers))
+        self.found_docs = set()
+        for docname in get_matching_docs(self.srcdir, config.source_suffix,
+                                         exclude_matchers=matchers):
+            if os.access(self.doc2path(docname), os.R_OK):
+                self.found_docs.add(docname)
+            else:
+                self.warn(docname, "document not readable. Ignored.")
 
         # add catalog mo file dependency
         for docname in self.found_docs:
@@ -1453,7 +1458,10 @@ class BuildEnvironment:
                             # nodes with length 1 don't have any children anyway
                             if len(toplevel) > 1:
                                 subtrees = toplevel.traverse(addnodes.toctree)
-                                toplevel[1][:] = subtrees
+                                if subtrees:
+                                    toplevel[1][:] = subtrees
+                                else:
+                                    toplevel.pop(1)
                     # resolve all sub-toctrees
                     for subtocnode in toc.traverse(addnodes.toctree):
                         if not (subtocnode.get('hidden', False) and
@@ -1499,6 +1507,9 @@ class BuildEnvironment:
         _toctree_add_classes(newnode, 1)
         self._toctree_prune(newnode, 1, prune and maxdepth or 0, collapse)
 
+        if len(newnode[-1]) == 0:  # No titles found
+            return None
+
         # set the target paths in the toctrees (they are not known at TOC
         # generation time)
         for refnode in newnode.traverse(nodes.reference):
diff --git a/sphinx/ext/intersphinx.py b/sphinx/ext/intersphinx.py
index 3501211..c43b8ae 100644
--- a/sphinx/ext/intersphinx.py
+++ b/sphinx/ext/intersphinx.py
@@ -34,7 +34,8 @@ from os import path
 import re
 
 from six import iteritems, string_types
-from six.moves.urllib import parse, request
+from six.moves.urllib import request
+from six.moves.urllib.parse import urlsplit, urlunsplit
 from docutils import nodes
 from docutils.utils import relative_path
 
@@ -105,7 +106,7 @@ def read_inventory_v2(f, uri, join, bufsize=16*1024):
 
     for line in split_lines(read_chunks()):
         # be careful to handle names with embedded spaces correctly
-        m = re.match(r'(?x)(.+?)\s+(\S*:\S*)\s+(\S+)\s+(\S+)\s+(.*)',
+        m = re.match(r'(?x)(.+?)\s+(\S*:\S*)\s+(-?\d+)\s+(\S+)\s+(.*)',
                      line.rstrip())
         if not m:
             continue
@@ -145,7 +146,7 @@ def _strip_basic_auth(url):
 
     :rtype: ``tuple``
     """
-    url_parts = parse.urlsplit(url)
+    url_parts = urlsplit(url)
     username = url_parts.username
     password = url_parts.password
     frags = list(url_parts)
@@ -154,7 +155,7 @@ def _strip_basic_auth(url):
         frags[1] = "%s:%s" % (url_parts.hostname, url_parts.port)
     else:
         frags[1] = url_parts.hostname
-    url = parse.urlunsplit(frags)
+    url = urlunsplit(frags)
     return (url, username, password)
 
 
@@ -208,12 +209,12 @@ def _get_safe_url(url):
     url, username, _ = _strip_basic_auth(url)
     if username is not None:
         # case: url contained basic auth creds; obscure password
-        url_parts = parse.urlsplit(url)
+        url_parts = urlsplit(url)
         safe_netloc = '{0}@{1}'.format(username, url_parts.hostname)
         # replace original netloc w/ obscured version
         frags = list(url_parts)
         frags[1] = safe_netloc
-        safe_url = parse.urlunsplit(frags)
+        safe_url = urlunsplit(frags)
 
     return safe_url
 
diff --git a/sphinx/ext/viewcode.py b/sphinx/ext/viewcode.py
index 89e7a99..a071c55 100644
--- a/sphinx/ext/viewcode.py
+++ b/sphinx/ext/viewcode.py
@@ -139,8 +139,8 @@ def collect_pages(app):
         # construct a page name for the highlighted source
         pagename = '_modules/' + modname.replace('.', '/')
         # highlight the source using the builder's highlighter
-        if env.config.highlight_language == 'python3':
-            lexer = 'python3'
+        if env.config.highlight_language in ('python3', 'default'):
+            lexer = env.config.highlight_language
         else:
             lexer = 'python'
         highlighted = highlighter.highlight_block(code, lexer, linenos=False)
diff --git a/sphinx/pycode/Grammar-py2-sphinx1.5.pickle b/sphinx/pycode/Grammar-py2-sphinx1.5.pickle
new file mode 100644
index 0000000..c0b8265
Binary files /dev/null and b/sphinx/pycode/Grammar-py2-sphinx1.5.pickle differ
diff --git a/sphinx/pycode/Grammar-py2.pickle b/sphinx/pycode/Grammar-py2.pickle
new file mode 100644
index 0000000..c0b8265
Binary files /dev/null and b/sphinx/pycode/Grammar-py2.pickle differ
diff --git a/sphinx/pycode/Grammar-py3-sphinx1.5.pickle b/sphinx/pycode/Grammar-py3-sphinx1.5.pickle
new file mode 100644
index 0000000..da44efc
Binary files /dev/null and b/sphinx/pycode/Grammar-py3-sphinx1.5.pickle differ
diff --git a/sphinx/pycode/Grammar-py3.pickle b/sphinx/pycode/Grammar-py3.pickle
new file mode 100644
index 0000000..da44efc
Binary files /dev/null and b/sphinx/pycode/Grammar-py3.pickle differ
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py
index 1f14c0d..4680fec 100644
--- a/sphinx/quickstart.py
+++ b/sphinx/quickstart.py
@@ -359,6 +359,12 @@ latex_documents = [
 #
 # latex_appendices = []
 
+# It false, will not define \strong, \code, \titleref, \crossref ... but only
+# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
+# packages.
+#
+# latex_keep_old_macro_names = True
+
 # If false, no module index is generated.
 #
 # latex_domain_indices = True
diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty
index 9b09b2b..a645836 100644
--- a/sphinx/texinputs/sphinx.sty
+++ b/sphinx/texinputs/sphinx.sty
@@ -8,6 +8,21 @@
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
 \ProvidesPackage{sphinx}[2010/01/15 LaTeX package (Sphinx markup)]
 
+% this is the \ltx at ifundefined of ltxcmds.sty, which is loaded by
+% hyperref.sty, but we need it before, and initial ltxcmds.sty
+% as in TL2009/Debian had wrong definition.
+\newcommand{\spx at ifundefined}[1]{%
+    \ifcsname #1\endcsname
+      \expandafter\ifx\csname #1\endcsname\relax
+        \expandafter\expandafter\expandafter\@firstoftwo
+      \else
+        \expandafter\expandafter\expandafter\@secondoftwo
+      \fi
+    \else
+      \expandafter\@firstoftwo
+    \fi
+}
+
 \@ifclassloaded{memoir}{}{\RequirePackage{fancyhdr}}
 
 % for \text macro and \iffirstchoice@ conditional even if amsmath not loaded
@@ -20,7 +35,7 @@
 \RequirePackage{makeidx}
 % For framing code-blocks and warning type notices, and shadowing topics
 \RequirePackage{framed}
-\newif\ifSphinx at inframed % flag set if we are in a framed environment
+\newif\ifspx at inframed % flag set if we are in a framed environment
 % ifthen not used anymore and will be removed at Sphinx-1.5
 \RequirePackage{ifthen}
 % The xcolor package draws better fcolorboxes around verbatim code
@@ -44,6 +59,9 @@
 \RequirePackage{alltt}
 % Display "real" single quotes in literal blocks.
 \RequirePackage{upquote}
+% For the H specifier. Do not \restylefloat{figure}, it breaks Sphinx code
+% for allowing figures in tables.
+\RequirePackage{float}
 
 % Redefine these colors to your liking in the preamble.
 \definecolor{TitleColor}{rgb}{0.126,0.263,0.361}
@@ -69,17 +87,19 @@
 \RequirePackage{graphicx}
 
 % for PDF output, use colors and maximal compression
-\newif\ifsphinxpdfoutput\sphinxpdfoutputfalse
-\ifx\pdfoutput\undefined\else\ifcase\pdfoutput
+\newif\ifsphinxpdfoutput % used in \maketitle
+\ifx\pdfoutput\undefined\else
+ \ifnum\pdfoutput=\z@
   \let\py at NormalColor\relax
   \let\py at TitleColor\relax
-\else
+ \else
   \sphinxpdfoutputtrue
   \input{pdfcolor}
   \def\py at NormalColor{\color[rgb]{0.0,0.0,0.0}}
   \def\py at TitleColor{\color{TitleColor}}
   \pdfcompresslevel=9
-\fi\fi
+ \fi
+\fi
 
 % XeLaTeX can do colors, too
 \ifx\XeTeXrevision\undefined\else
@@ -114,9 +134,10 @@
 
 % Use this to set the font family for headers and other decor:
 \newcommand{\py at HeaderFamily}{\sffamily\bfseries}
+\newcommand{\sphinxSetHeaderFamily}[1]{\renewcommand{\py at HeaderFamily}{#1}}
 
 % Redefine the 'normal' header/footer style when using "fancyhdr" package:
-\@ifundefined{fancyhf}{}{
+\spx at ifundefined{fancyhf}{}{
   % Use \pagestyle{normal} as the primary pagestyle for text.
   \fancypagestyle{normal}{
     \fancyhf{}
@@ -127,9 +148,8 @@
     \renewcommand{\headrulewidth}{0.4pt}
     \renewcommand{\footrulewidth}{0.4pt}
     % define chaptermark with \@chappos when \@chappos is available for Japanese
-    \ifx\@chappos\undefined\else
-      \def\chaptermark##1{\markboth{\@chapapp\space\thechapter\space\@chappos\space ##1}{}}
-    \fi
+    \spx at ifundefined{@chappos}{}
+      {\def\chaptermark##1{\markboth{\@chapapp\space\thechapter\space\@chappos\space ##1}{}}}
   }
   % Update the plain style so we get the page number & footer line,
   % but not a chapter or section title.  This is to keep the first
@@ -143,23 +163,23 @@
 }
 
 % Some custom font markup commands.
-%
-\newcommand{\strong}[1]{{\textbf{#1}}}
-% let \code and \bfcode use straight quotes (\@noligs patched by upquote)
-% use \scantokens to handle e.g. \item[{\code{'fontenc'}}], too late for
-% \code to change catcodes.
-\newcommand{\code}[1]{{\@noligs\scantokens{\texttt{#1}}}}
-\newcommand{\bfcode}[1]{\code{\bfseries#1}}
-\newcommand{\email}[1]{\textsf{#1}}
-\newcommand{\tablecontinued}[1]{\textsf{#1}}
-\newcommand{\titleref}[1]{\emph{#1}}
-\newcommand{\menuselection}[1]{\emph{#1}}
-\newcommand{\accelerator}[1]{\underline{#1}}
-\newcommand{\crossref}[1]{\emph{#1}}
-\newcommand{\termref}[1]{\emph{#1}}
-
+% *** the macros without \sphinx prefix are still defined at bottom of file ***
+\newcommand{\sphinxstrong}[1]{{\textbf{#1}}}
+% let \sphinxcode and \sphinxbfcode use straight quotes. \@noligs patched by upquote,
+% but needs protection in "moving arguments" such as for captions.
+% Use \scantokens to handle e.g. \item[{\sphinxcode{'fontenc'}}]
+\DeclareRobustCommand{\sphinxcode}[1]{{\@noligs\scantokens{\texttt{#1}\relax}}}
+\newcommand{\sphinxbfcode}[1]{\sphinxcode{\bfseries#1}}
+\newcommand{\sphinxemail}[1]{\textsf{#1}}
+\newcommand{\sphinxtablecontinued}[1]{\textsf{#1}}
+\newcommand{\sphinxtitleref}[1]{\emph{#1}}
+\newcommand{\sphinxmenuselection}[1]{\emph{#1}}
+\newcommand{\sphinxaccelerator}[1]{\underline{#1}}
+\newcommand{\sphinxcrossref}[1]{\emph{#1}}
+\newcommand{\sphinxtermref}[1]{\emph{#1}}
+
+% miscellaneous related to footnotes
 \newcommand*{\sphinxAtStartFootnote}{\mbox{ }}
-
 % Support large numbered footnotes in minipage (cf. admonitions)
 \def\thempfootnote{\arabic{mpfootnote}}
 
@@ -169,8 +189,8 @@
 \let\OriginalVerbatim=\Verbatim
 \let\endOriginalVerbatim=\endVerbatim
 
-\newcommand\Sphinx at colorbox [2]{%
-% #1 will be \fcolorbox or, for first part of frame: \Sphinx at fcolorbox
+\newcommand\spx at colorbox [2]{%
+% #1 will be \fcolorbox or, for first part of frame: \spx at fcolorbox
 % let the framing obey the current indentation (adapted from framed.sty's code).
   \hskip\@totalleftmargin
   \hskip-\fboxsep\hskip-\fboxrule
@@ -179,47 +199,46 @@
   \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth
 }
 % use of \color at b@x here is compatible with both xcolor.sty and color.sty
-\def\Sphinx at fcolorbox #1#2%
-  {\color at b@x {\fboxsep\z@\color{#1}\Sphinx at VerbatimFBox}{\color{#2}}}%
+\def\spx at fcolorbox #1#2%
+  {\color at b@x {\fboxsep\z@\color{#1}\spx at VerbatimFBox}{\color{#2}}}%
 
-% The title is specified from outside as macro \SphinxVerbatimTitle.
-% \SphinxVerbatimTitle is reset to empty after each use of Verbatim.
-\newcommand*\SphinxVerbatimTitle {}
+% The title is specified from outside as macro \sphinxVerbatimTitle.
+% \sphinxVerbatimTitle is reset to empty after each use of Verbatim.
+\newcommand*\sphinxVerbatimTitle {}
 % Holder macro for labels of literal blocks. Set-up by LaTeX writer.
-\newcommand*\SphinxLiteralBlockLabel {}
-\newcommand*\SphinxSetupCaptionForVerbatim [2]
+\newcommand*\sphinxLiteralBlockLabel {}
+\newcommand*\sphinxSetupCaptionForVerbatim [2]
 {%
-    \needspace{\literalblockneedspace}%
-% insert a \label via \SphinxLiteralBlockLabel
+    \needspace{\sphinxliteralblockneedspace}%
+% insert a \label via \sphinxLiteralBlockLabel
 % reset to normal the color for the literal block caption
 % the caption inserts \abovecaptionskip whitespace above itself (usually 10pt)
 % there is also \belowcaptionskip but it is usually zero, hence the \smallskip
-    \def\SphinxVerbatimTitle
-       {\py at NormalColor\captionof{#1}{\SphinxLiteralBlockLabel #2}\smallskip }%
+    \def\sphinxVerbatimTitle
+       {\py at NormalColor\captionof{#1}{\sphinxLiteralBlockLabel #2}\smallskip }%
 }
 
 % Inspired and adapted from framed.sty's \CustomFBox with extra handling
 % of a non separable by pagebreak caption, and controlled counter stepping.
-\newif\ifSphinx at myfirstframedpass
-
-\long\def\Sphinx at VerbatimFBox#1{%
+\newif\ifspx at myfirstframedpass
+\long\def\spx at VerbatimFBox#1{%
   \leavevmode
   \begingroup
   % framed.sty does some measuring but this macro adds possibly a caption
   % use amsmath conditional to inhibit the caption counter stepping after
   % first pass
-  \ifSphinx at myfirstframedpass\else\firstchoice at false\fi
+  \ifspx at myfirstframedpass\else\firstchoice at false\fi
   \setbox\@tempboxa\hbox{\kern\fboxsep{#1}\kern\fboxsep}%
    \hbox
    {\lower\dimexpr\fboxrule+\fboxsep+\dp\@tempboxa
     \hbox{%
-      \vbox{\ifx\SphinxVerbatimTitle\empty\else
+      \vbox{\ifx\sphinxVerbatimTitle\empty\else
             % add the caption in a centered way above possibly indented frame
             % hide its width from framed.sty's measuring step
             % note that the caption brings \abovecaptionskip top vertical space
             \moveright\dimexpr\fboxrule+.5\wd\@tempboxa
                   \hb at xt@\z@{\hss\begin{minipage}{\wd\@tempboxa}%
-                                  \SphinxVerbatimTitle
+                                  \sphinxVerbatimTitle
                                  \end{minipage}\hss}\fi
             % draw frame border _latest_ to avoid pdf viewer issue
             \kern\fboxrule
@@ -236,51 +255,51 @@
             \hrule\@height\fboxrule}%
    }}%
   \endgroup
-  \global\Sphinx at myfirstframedpassfalse
+  \global\spx at myfirstframedpassfalse
 }
 
 % For linebreaks inside Verbatim environment from package fancyvrb.
-\newbox\Sphinxcontinuationbox
-\newbox\Sphinxvisiblespacebox
+\newbox\sphinxcontinuationbox
+\newbox\sphinxvisiblespacebox
 % These are user customizable e.g. from latex_elements's preamble key.
 % Use of \textvisiblespace for compatibility with XeTeX/LuaTeX/fontspec.
-\newcommand*\Sphinxvisiblespace {\textcolor{red}{\textvisiblespace}}
-\newcommand*\Sphinxcontinuationsymbol {\textcolor{red}{\llap{\tiny$\m at th\hookrightarrow$}}}
-\newcommand*\Sphinxcontinuationindent {3ex }
-\newcommand*\Sphinxafterbreak {\kern\Sphinxcontinuationindent\copy\Sphinxcontinuationbox}
+\newcommand*\sphinxvisiblespace {\textcolor{red}{\textvisiblespace}}
+\newcommand*\sphinxcontinuationsymbol {\textcolor{red}{\llap{\tiny$\m at th\hookrightarrow$}}}
+\newcommand*\sphinxcontinuationindent {3ex }
+\newcommand*\sphinxafterbreak {\kern\sphinxcontinuationindent\copy\sphinxcontinuationbox}
 
 % Take advantage of the already applied Pygments mark-up to insert
 % potential linebreaks for TeX processing.
 %        {, <, #, %, $, ' and ": go to next line.
 %        _, }, ^, &, >, - and ~: stay at end of broken line.
 % Use of \textquotesingle for straight quote.
-\newcommand*\Sphinxbreaksatspecials {%
-    \def\PYGZus{\discretionary{\char`\_}{\Sphinxafterbreak}{\char`\_}}%
-    \def\PYGZob{\discretionary{}{\Sphinxafterbreak\char`\{}{\char`\{}}%
-    \def\PYGZcb{\discretionary{\char`\}}{\Sphinxafterbreak}{\char`\}}}%
-    \def\PYGZca{\discretionary{\char`\^}{\Sphinxafterbreak}{\char`\^}}%
-    \def\PYGZam{\discretionary{\char`\&}{\Sphinxafterbreak}{\char`\&}}%
-    \def\PYGZlt{\discretionary{}{\Sphinxafterbreak\char`\<}{\char`\<}}%
-    \def\PYGZgt{\discretionary{\char`\>}{\Sphinxafterbreak}{\char`\>}}%
-    \def\PYGZsh{\discretionary{}{\Sphinxafterbreak\char`\#}{\char`\#}}%
-    \def\PYGZpc{\discretionary{}{\Sphinxafterbreak\char`\%}{\char`\%}}%
-    \def\PYGZdl{\discretionary{}{\Sphinxafterbreak\char`\$}{\char`\$}}%
-    \def\PYGZhy{\discretionary{\char`\-}{\Sphinxafterbreak}{\char`\-}}%
-    \def\PYGZsq{\discretionary{}{\Sphinxafterbreak\textquotesingle}{\textquotesingle}}%
-    \def\PYGZdq{\discretionary{}{\Sphinxafterbreak\char`\"}{\char`\"}}%
-    \def\PYGZti{\discretionary{\char`\~}{\Sphinxafterbreak}{\char`\~}}%
+\newcommand*\sphinxbreaksatspecials {%
+    \def\PYGZus{\discretionary{\char`\_}{\sphinxafterbreak}{\char`\_}}%
+    \def\PYGZob{\discretionary{}{\sphinxafterbreak\char`\{}{\char`\{}}%
+    \def\PYGZcb{\discretionary{\char`\}}{\sphinxafterbreak}{\char`\}}}%
+    \def\PYGZca{\discretionary{\char`\^}{\sphinxafterbreak}{\char`\^}}%
+    \def\PYGZam{\discretionary{\char`\&}{\sphinxafterbreak}{\char`\&}}%
+    \def\PYGZlt{\discretionary{}{\sphinxafterbreak\char`\<}{\char`\<}}%
+    \def\PYGZgt{\discretionary{\char`\>}{\sphinxafterbreak}{\char`\>}}%
... 1163 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/sphinx.git



More information about the Python-modules-commits mailing list