[Python-checkins] r64808 - in doctools/branches/0.4.x: CHANGES sphinx/builder.py sphinx/environment.py

georg.brandl python-checkins at python.org
Tue Jul 8 21:39:33 CEST 2008


Author: georg.brandl
Date: Tue Jul  8 21:39:33 2008
New Revision: 64808

Log:
Allow relocation of source and doctree dir.


Modified:
   doctools/branches/0.4.x/CHANGES
   doctools/branches/0.4.x/sphinx/builder.py
   doctools/branches/0.4.x/sphinx/environment.py

Modified: doctools/branches/0.4.x/CHANGES
==============================================================================
--- doctools/branches/0.4.x/CHANGES	(original)
+++ doctools/branches/0.4.x/CHANGES	Tue Jul  8 21:39:33 2008
@@ -7,6 +7,9 @@
 * The automodule directive now accepts the ``inherited-members``
   and ``show-inheritance`` options again.
 
+* You can now rebuild the docs normally after relocating the source
+  and/or doctree directory.
+
 
 Release 0.4.1 (Jul 5, 2008)
 ===========================

Modified: doctools/branches/0.4.x/sphinx/builder.py
==============================================================================
--- doctools/branches/0.4.x/sphinx/builder.py	(original)
+++ doctools/branches/0.4.x/sphinx/builder.py	Tue Jul  8 21:39:33 2008
@@ -211,7 +211,7 @@
         warnings = []
         self.env.set_warnfunc(warnings.append)
         self.info(bold('updating environment: '), nonl=1)
-        iterator = self.env.update(self.config, self.app)
+        iterator = self.env.update(self.config, self.srcdir, self.doctreedir, self.app)
         # the first item in the iterator is a summary message
         self.info(iterator.next())
         for docname in self.status_iterator(iterator, 'reading... ', purple):

Modified: doctools/branches/0.4.x/sphinx/environment.py
==============================================================================
--- doctools/branches/0.4.x/sphinx/environment.py	(original)
+++ doctools/branches/0.4.x/sphinx/environment.py	Tue Jul  8 21:39:33 2008
@@ -396,7 +396,7 @@
 
         return added, changed, removed
 
-    def update(self, config, app=None):
+    def update(self, config, srcdir, doctreedir, app=None):
         """(Re-)read all files new or changed since last update.  Yields a summary
         and then docnames as it processes them.  Store all environment docnames
         in the canonical format (ie using SEP as a separator in place of
@@ -416,6 +416,9 @@
                     break
             else:
                 msg = ''
+        # the source and doctree directories may have been relocated
+        self.srcdir = srcdir
+        self.doctreedir = doctreedir
         self.find_files(config)
         added, changed, removed = self.get_outdated_files(config_changed)
         msg += '%s added, %s changed, %s removed' % (len(added), len(changed),


More information about the Python-checkins mailing list