Commits

Georg Brandl committed 85d2f30 Merge

merge with 1.0

Comments (0)

Files changed (14)

 Release 1.0.4 (Sep 17, 2010)
 ============================
 
+* #544: Allow ``.pyw`` as a source file extension.
+
 * #524: Open intersphinx inventories in binary mode on Windows,
   since version 2 contains zlib-compressed data.
 
 * pip: http://pip.openplans.org/ (nature)
 * Programmieren mit PyGTK und Glade (German):
   http://www.florian-diesch.de/doc/python-und-glade/online/ (agogo)
+* pypol: http://pypol.altervista.org/ (nature)
 * Spring Python: http://springpython.webfactional.com/current/sphinx/index.html
   (nature)
 * sqlparse: http://python-sqlparse.googlecode.com/svn/docs/api/index.html
Added
New image

doc/_templates/indexsidebar.html

+<p class="logo"><a href="http://pocoo.org/">
+  <img src="{{ pathto("_static/pocoo.png", 1) }}" /></a></p>
+
 <h3>Download</h3>
 {% if version.endswith('(hg)') %}
 <p>This documentation is for version <b>{{ version }}</b>, which is
 html_theme = 'sphinxdoc'
 modindex_common_prefix = ['sphinx.']
 html_static_path = ['_static']
-html_index = 'index.html'
 html_sidebars = {'index': ['indexsidebar.html', 'searchbox.html']}
 html_additional_pages = {'index': 'index.html'}
 html_use_opensearch = 'http://sphinx.pocoo.org'
    Example patterns:
 
    - ``'library/xml.rst'`` -- ignores the ``library/xml.rst`` file (replaces
-     entry in :confval:`unused_docs`
+     entry in :confval:`unused_docs`)
    - ``'library/xml'`` -- ignores the ``library/xml`` directory (replaces entry
      in :confval:`exclude_trees`)
    - ``'library/xml*'`` -- ignores all files and directories starting with

sphinx/application.py

         self.builder.cleanup()
 
     def warn(self, message, location=None, prefix='WARNING: '):
+        if isinstance(location, tuple):
+            docname, lineno = location
+            if docname:
+                location = '%s:%s' % (self.env.doc2path(docname), lineno or '')
+            else:
+                location = None
         warntext = location and '%s: %s%s\n' % (location, prefix, message) or \
                    '%s%s\n' % (prefix, message)
         if self.warningiserror:

sphinx/builders/html.py

         self.tags_hash = ''
         # section numbers for headings in the currently visited document
         self.secnumbers = {}
+        # currently written docname
+        self.current_docname = None
 
         self.init_templates()
         self.init_highlighter()
         self.imgpath = relative_uri(self.get_target_uri(docname), '_images')
         self.post_process_images(doctree)
         self.dlpath = relative_uri(self.get_target_uri(docname), '_downloads')
+        self.current_docname = docname
         self.docwriter.write(doctree, destination)
         self.docwriter.assemble_parts()
         body = self.docwriter.parts['fragment']

sphinx/environment.py

         self.settings['warning_stream'] = WarningStream(func)
 
     def warn(self, docname, msg, lineno=None):
-        if docname:
-            if lineno is None:
-                lineno = ''
-            self._warnfunc(msg, '%s:%s' % (self.doc2path(docname), lineno))
-        else:
-            self._warnfunc(msg)
+        # strange argument order is due to backwards compatibility
+        self._warnfunc(msg, (docname, lineno))
 
     def clear_doc(self, docname):
         """Remove all traces of a source file in the inventory."""

sphinx/ext/autodoc.py

             # parse right now, to get PycodeErrors on parsing (results will
             # be cached anyway)
             self.analyzer.find_attr_docs()
-        except PycodeError, err:
+        except PycodeError:
             # no source file -- e.g. for builtin and C modules
             self.analyzer = None
             # at least add the module.__file__ as a dependency

sphinx/highlighting.py

                     lexer = lexers[lang] = get_lexer_by_name(lang)
                 except ClassNotFound:
                     if warn:
-                        warn('Pygments lexer name %s is not known' % lang)
+                        warn('Pygments lexer name %r is not known' % lang)
                         return self.unhighlighted(source)
                     else:
                         raise

sphinx/util/__init__.py

     lfilename = filename.lower()
     if lfilename.endswith('.pyo') or lfilename.endswith('.pyc'):
         filename = filename[:-1]
-    elif not lfilename.endswith('.py'):
+    elif not (lfilename.endswith('.py') or lfilename.endswith('.pyw')):
         raise PycodeError('source is not a .py file: %r' % filename)
     if not path.isfile(filename):
         raise PycodeError('source file is not present: %r' % filename)

sphinx/writers/html.py

             lang = node['language']
         if node.has_key('linenos'):
             linenos = node['linenos']
-        highlighted = self.highlighter.highlight_block(node.rawsource,
-                                                       lang, linenos)
+        def warner(msg):
+            self.builder.warn(msg, (self.builder.current_docname, node.line))
+        highlighted = self.highlighter.highlight_block(
+            node.rawsource, lang, linenos, warn=warner)
         starttag = self.starttag(node, 'div', suffix='',
                                  CLASS='highlight-%s' % lang)
         self.body.append(starttag + highlighted + '</div>\n')

sphinx/writers/latex.py

         elif self.this_is_the_title:
             if len(node.children) != 1 and not isinstance(node.children[0],
                                                           nodes.Text):
-                self.builder.warn(
-                    'document title is not a single Text node',
-                    '%s:%s' % (self.builder.env.doc2path(self.curfilestack[-1]),
-                               node.line or ''))
+                self.builder.warn('document title is not a single Text node',
+                                  (self.curfilestack[-1], node.line))
             if not self.elements['title']:
                 # text needs to be escaped since it is inserted into
                 # the output literally
             self.builder.warn(
                 'encountered title node not in section, topic, table, '
                 'admonition or sidebar',
-                '%s:%s' % (self.builder.env.doc2path(self.curfilestack[-1]),
-                           node.line or ''))
+                (self.curfilestack[-1], node.line or ''))
             self.body.append('\\textbf{')
             self.context.append('}\n')
         self.in_title = 1
                 self.body.append('\\grammartoken{')
             self.context.append('}')
         else:
-            self.builder.warn(
-                'unusable reference target found: %s' % uri,
-                '%s:%s' % (self.builder.env.doc2path(self.curfilestack[-1]),
-                           node.line or ''))
+            self.builder.warn('unusable reference target found: %s' % uri,
+                              (self.curfilestack[-1], node.line))
             self.context.append('')
     def depart_reference(self, node):
         self.body.append(self.context.pop())
             lang = node['language']
         if 'linenos' in node:
             linenos = node['linenos']
-        hlcode = self.highlighter.highlight_block(code, lang, linenos)
+        def warner(msg):
+            self.builder.warn(msg, (self.curfilestack[-1], node.line))
+        hlcode = self.highlighter.highlight_block(code, lang, linenos,
+                                                  warn=warner)
         # workaround for Unicode issue
         hlcode = hlcode.replace(u'€', u'@texteuro[]')
         # must use original Verbatim environment and "tabular" environment
         * inline markup is supported.
         * serif typeface
         """
-        self.body.append('{\\raggedright{}')
+        self.body.append('\n{\\raggedright{}')
         self.literal_whitespace += 1
     def depart_line_block(self, node):
         self.literal_whitespace -= 1
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.