Commits

Anonymous committed 706016e

Don't try to build copied sources if source suffix is .txt.

  • Participants
  • Parent commits e2df7b1

Comments (0)

Files changed (4)

 * sphinx.quickstart: Really don't create a makefile if the user
   doesn't want one.
 
+* setup: Don't install scripts twice, via setuptools entry points
+  and distutils scripts.  Only install via entry points.
+
+* sphinx.builder: Don't recognize the HTML builder's copied source
+  files (under _sources) as input files if the source suffix is
+  ``.txt``.
+
+
 Release 0.1.61798 (Mar 23, 2008)
 ================================
 

File sphinx/builder.py

         # dump the search index
         self.handle_finish()
 
-    # --------- these are overwritten by the Web builder
+    # --------- these are overwritten by the Pickle builder
 
     def get_target_uri(self, docname, typ=None):
         return docname + '.html'
     def get_outdated_docs(self):
         for docname in get_matching_docs(
             self.srcdir, self.config.source_suffix,
-            exclude=set(self.config.unused_docs)):
+            exclude=set(self.config.unused_docs),
+            prune=['_sources']):
             targetname = self.env.doc2path(docname, self.outdir, '.html')
             try:
                 targetmtime = path.getmtime(targetname)
             f.close()
 
 
-class WebHTMLBuilder(StandaloneHTMLBuilder):
+class PickleHTMLBuilder(StandaloneHTMLBuilder):
     """
-    Builds HTML docs usable with the web-based doc server.
+    Builds HTML docs without rendering templates.
     """
-    name = 'web'
+    name = 'pickle'
 
     def init(self):
         self.init_translator_class()
     def get_outdated_docs(self):
         for docname in get_matching_docs(
             self.srcdir, self.config.source_suffix,
-            exclude=set(self.config.unused_docs)):
+            exclude=set(self.config.unused_docs),
+            prune=['_sources']):
             targetname = self.env.doc2path(docname, self.outdir, '.fpickle')
             try:
                 targetmtime = path.getmtime(targetname)
         finally:
             f.close()
 
-        # if there is a source file, copy the source file for the "show source" link
+        # if there is a source file, copy the source file for the
+        # "show source" link
         if ctx.get('sourcename'):
             source_name = path.join(self.outdir, 'sources',
                                     os_path(ctx['sourcename']))
     def finish(self):
         pass
 
+# compatibility alias
+WebHTMLBuilder = PickleHTMLBuilder
+
 
 from sphinx.linkcheck import CheckExternalLinksBuilder
 
 builtin_builders = {
     'html': StandaloneHTMLBuilder,
-    'web': WebHTMLBuilder,
+    'pickle': PickleHTMLBuilder,
+    'web': PickleHTMLBuilder,
     'htmlhelp': HTMLHelpBuilder,
     'latex': LaTeXBuilder,
     'changes': ChangesBuilder,

File sphinx/environment.py

         Return (added, changed, removed) sets.
         """
         self.found_docs = set(get_matching_docs(self.srcdir, config.source_suffix,
-                                                exclude=set(config.unused_docs)))
+                                                exclude=set(config.unused_docs),
+                                                prune=['_sources']))
 
         # clear all files no longer present
         removed = set(self.all_docs) - self.found_docs

File sphinx/util/__init__.py

             raise
 
 
-def get_matching_docs(dirname, suffix, exclude=()):
+def get_matching_docs(dirname, suffix, exclude=(), prune=()):
     """
     Get all file names (without suffix) matching a suffix in a
     directory, recursively.
     for root, dirs, files in os.walk(dirname):
         dirs.sort()
         files.sort()
+        for prunedir in prune:
+            if prunedir in dirs:
+                dirs.remove(prunedir)
         for sfile in files:
             if not fnmatch.fnmatch(sfile, pattern):
                 continue