Georg Brandl avatar Georg Brandl committed 17be832 Merge

merge heads

Comments (0)

Files changed (8)

doc/ext/linkcode.rst

 ``sphinx.ext.viewcode`` extension, but assumes the source code can be
 found somewhere on the Internet.
 
-In your configuration, you need to specify a :confval:`linkcode_resolve` 
+In your configuration, you need to specify a :confval:`linkcode_resolve`
 function that returns an URL based on the object.
 
 .. confval:: linkcode_resolve
 
    This is a function ``linkcode_resolve(domain, info)``,
    which should return the URL to source code corresponding to
-   the object in given domain with given information. 
+   the object in given domain with given information.
 
    The function should return ``None`` if no link is to be added.
 
       def linkcode_resolve(domain, info):
           if domain != 'py':
               return None
-	  if not info['module']:
-	      return None
-	  filename = info['module'].replace('.', '/')
+          if not info['module']:
+              return None
+          filename = info['module'].replace('.', '/')
           return "http://somesite/sourcerepo/%s.py" % filename
     print('ERROR: Sphinx requires at least Python 2.5 to run.')
     sys.exit(1)
 
+if sys.version_info[:3] >= (3, 3, 0):
+    try:
+        import docutils
+        x, y = docutils.__version__.split('.')[:2]
+        if (int(x), int(y)) < (0, 10):
+            sys.stderr.write('ERROR: Sphinx requires at least '
+                             'Docutils 0.10 for Python 3.3 and above.\n')
+            sys.exit(1)
+    except Exception:
+        pass
 
 # Provide a "compile_catalog" command that also creates the translated
 # JavaScript files if Babel is available.

sphinx/builders/linkcheck.py

 
         def check():
             # check for various conditions without bothering the network
-            if len(uri) == 0 or uri[0] == '#' or uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:':
+            if len(uri) == 0 or uri[0] == '#' or \
+               uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:':
                 return 'unchecked', ''
             elif not (uri[0:5] == 'http:' or uri[0:6] == 'https:'):
                 return 'local', ''

sphinx/ext/graphviz.py

               str(self.builder.config.graphviz_dot) + \
               str(self.builder.config.graphviz_dot_args)
               ).encode('utf-8')
-              
+
     fname = '%s-%s.%s' % (prefix, sha(hashkey).hexdigest(), format)
     if hasattr(self.builder, 'imgpath'):
         # HTML

sphinx/quickstart.py

 \t@echo "  epub       to make an epub"
 \t@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
 \t@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
-\t@echo "  latexpdfja to make LaTeX files and run them through platex and dvipdfmx"
+\t@echo "  latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
 \t@echo "  text       to make text files"
 \t@echo "  man        to make manual pages"
 \t@echo "  texinfo    to make Texinfo files"

sphinx/util/nodes.py

     """Extract translatable messages from a document tree."""
     for node in doctree.traverse(nodes.TextElement):
         # workaround: nodes.term doesn't have source, line and rawsource
-        # It should be fixed in Docutils. There is a patch for it in Docutils
-        # tracker: https://sourceforge.net/tracker/?func=detail&aid=3548418&group_id=38414&atid=422032
+        # (fixed in Docutils r7495)
         if isinstance(node, nodes.term) and not node.source:
             definition_list_item = node.parent
             if definition_list_item.line is not None:
                 node.source = definition_list_item.source
                 node.line = definition_list_item.line - 1
-                node.rawsource = definition_list_item.rawsource.split("\n", 2)[0]
+                node.rawsource = definition_list_item.\
+                                 rawsource.split("\n", 2)[0]
         if not node.source:
             continue # built-in message
         if isinstance(node, IGNORED_NODES):

sphinx/util/osutil.py

         # returns '', not 'index.html'
         return ''
     if len(b2) == 1 and t2 == ['']:
-        # Special case: relative_uri('f/index.html','f/') should 
+        # Special case: relative_uri('f/index.html','f/') should
         # return './', not ''
         return '.' +  SEP
     return ('..' + SEP) * (len(b2)-1) + SEP.join(t2)

sphinx/writers/latex.py

 class ExtBabel(Babel):
     def get_shorthandoff(self):
         shortlang = self.language.split('_')[0]
-        if shortlang in ('de', 'ngerman', 'sl', 'slovene', 'pt', 'portuges', 'es', 'spanish',
-                         'nl', 'dutch', 'pl', 'polish', 'it', 'italian'):
+        if shortlang in ('de', 'ngerman', 'sl', 'slovene', 'pt', 'portuges',
+                         'es', 'spanish', 'nl', 'dutch', 'pl', 'polish', 'it',
+                         'italian'):
             return '\\shorthandoff{"}'
         return ''
 
         # allow the user to override them all
         self.elements.update(builder.config.latex_elements)
         if self.elements['extraclassoptions']:
-            self.elements['classoptions'] += ',' + self.elements['extraclassoptions']
+            self.elements['classoptions'] += ',' + \
+                                             self.elements['extraclassoptions']
 
         self.highlighter = highlighting.PygmentsBridge('latex',
             builder.config.pygments_style, builder.config.trim_doctest_flags)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.