[Python-checkins] r65101 - in doctools/branches/0.4.x: sphinx/quickstart.py sphinx/templates/genindex-split.html sphinx/templates/genindex.html sphinx/util/__init__.py tests/path.py utils/check_sources.py

georg.brandl python-checkins at python.org
Fri Jul 18 14:55:04 CEST 2008


Author: georg.brandl
Date: Fri Jul 18 14:55:03 2008
New Revision: 65101

Log:
Fix problems in "make check".


Modified:
   doctools/branches/0.4.x/sphinx/quickstart.py
   doctools/branches/0.4.x/sphinx/templates/genindex-split.html
   doctools/branches/0.4.x/sphinx/templates/genindex.html
   doctools/branches/0.4.x/sphinx/util/__init__.py
   doctools/branches/0.4.x/tests/path.py
   doctools/branches/0.4.x/utils/check_sources.py

Modified: doctools/branches/0.4.x/sphinx/quickstart.py
==============================================================================
--- doctools/branches/0.4.x/sphinx/quickstart.py	(original)
+++ doctools/branches/0.4.x/sphinx/quickstart.py	Fri Jul 18 14:55:03 2008
@@ -178,7 +178,8 @@
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title, author, document class [howto/manual]).
 latex_documents = [
-  ('%(master)s', '%(project_fn)s.tex', '%(project)s Documentation', '%(author)s', 'manual'),
+  ('%(master)s', '%(project_fn)s.tex', '%(project)s Documentation',
+   '%(author)s', 'manual'),
 ]
 
 # The name of an image file (relative to this directory) to place at the top of
@@ -233,7 +234,8 @@
 # Internal variables.
 PAPEROPT_a4     = -D latex_paper_size=a4
 PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS   = -d %(rbuilddir)s/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) %(rsrcdir)s
+ALLSPHINXOPTS   = -d %(rbuilddir)s/doctrees $(PAPEROPT_$(PAPER)) \
+$(SPHINXOPTS) %(rsrcdir)s
 
 .PHONY: help clean html web pickle htmlhelp latex changes linkcheck
 

Modified: doctools/branches/0.4.x/sphinx/templates/genindex-split.html
==============================================================================
--- doctools/branches/0.4.x/sphinx/templates/genindex-split.html	(original)
+++ doctools/branches/0.4.x/sphinx/templates/genindex-split.html	Fri Jul 18 14:55:03 2008
@@ -5,7 +5,7 @@
    <h1 id="index">Index</h1>
 
    <p>Index pages by letter:</p>
-     
+
    <p>{% for key, dummy in genindexentries -%}
    <a href="{{ pathto('genindex-' + key) }}"><strong>{{ key }}</strong></a>
      {% if not loop.last %}| {% endif %}
@@ -25,5 +25,5 @@
    {%- endfor %}</p>
 
    <p><a href="{{ pathto('genindex-all') }}"><strong>Full index on one page</strong></a></p>
-{% endif %} 
+{% endif %}
 {% endblock %}

Modified: doctools/branches/0.4.x/sphinx/templates/genindex.html
==============================================================================
--- doctools/branches/0.4.x/sphinx/templates/genindex.html	(original)
+++ doctools/branches/0.4.x/sphinx/templates/genindex.html	Fri Jul 18 14:55:03 2008
@@ -52,5 +52,5 @@
    {%- endfor %}</p>
 
    <p><a href="{{ pathto('genindex-all') }}"><strong>Full index on one page</strong></a></p>
-{% endif %} 
+{% endif %}
 {% endblock %}

Modified: doctools/branches/0.4.x/sphinx/util/__init__.py
==============================================================================
--- doctools/branches/0.4.x/sphinx/util/__init__.py	(original)
+++ doctools/branches/0.4.x/sphinx/util/__init__.py	Fri Jul 18 14:55:03 2008
@@ -250,7 +250,7 @@
     Adapted from fnmatch module.
     """
     result = []
-    if not pat in _pat_cache:
+    if pat not in _pat_cache:
         _pat_cache[pat] = re.compile(_translate_pattern(pat))
     match = _pat_cache[pat].match
     return filter(match, names)

Modified: doctools/branches/0.4.x/tests/path.py
==============================================================================
--- doctools/branches/0.4.x/tests/path.py	(original)
+++ doctools/branches/0.4.x/tests/path.py	Fri Jul 18 14:55:03 2008
@@ -353,7 +353,7 @@
         whose names match the given pattern.  For example,
         d.files('*.pyc').
         """
-        
+
         return [p for p in self.listdir(pattern) if p.isfile()]
 
     def walk(self, pattern=None, errors='strict'):

Modified: doctools/branches/0.4.x/utils/check_sources.py
==============================================================================
--- doctools/branches/0.4.x/utils/check_sources.py	(original)
+++ doctools/branches/0.4.x/utils/check_sources.py	Fri Jul 18 14:55:03 2008
@@ -7,7 +7,7 @@
     Make sure each Python file has a correct file header
     including copyright and license information.
 
-    :copyright: 2006-2007 by Georg Brandl.
+    :copyright: 2006-2008 by Georg Brandl.
     :license: GNU GPL, see LICENSE for more details.
 """
 
@@ -57,15 +57,17 @@
     for lno, line in enumerate(lines):
         if len(line) > 90:
             yield lno+1, "line too long"
+        if lno < 2:
+            co = coding_re.search(line)
+            if co:
+                encoding = co.group(1)
+        if line.strip().startswith('#'):
+            continue
         m = not_ix_re.search(line)
         if m:
             yield lno+1, '"' + m.group() + '"'
         if is_const_re.search(line):
             yield lno+1, 'using == None/True/False'
-        if lno < 2:
-            co = coding_re.search(line)
-            if co:
-                encoding = co.group(1)
         try:
             line.decode(encoding)
         except UnicodeDecodeError, err:


More information about the Python-checkins mailing list