summaryrefslogtreecommitdiff
path: root/sandbox/py-rest-doc/sphinx/environment.py
diff options
context:
space:
mode:
authorgbrandl <gbrandl@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2007-05-25 19:14:12 +0000
committergbrandl <gbrandl@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2007-05-25 19:14:12 +0000
commit00fcc06250b10fddf7fd9fdebfcec5b2c957df32 (patch)
tree336b3dc7c4f92764882dee3057be41ab88040062 /sandbox/py-rest-doc/sphinx/environment.py
parent583529f533a4f63a8d7debfb981e065eff2ff8a3 (diff)
downloaddocutils-00fcc06250b10fddf7fd9fdebfcec5b2c957df32.tar.gz
Restructure the page retrieval system a bit. It's still a bit of a mess.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5153 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'sandbox/py-rest-doc/sphinx/environment.py')
-rw-r--r--sandbox/py-rest-doc/sphinx/environment.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/sandbox/py-rest-doc/sphinx/environment.py b/sandbox/py-rest-doc/sphinx/environment.py
index 6eefcc24c..b131d416c 100644
--- a/sandbox/py-rest-doc/sphinx/environment.py
+++ b/sandbox/py-rest-doc/sphinx/environment.py
@@ -155,6 +155,8 @@ class BuildEnvironment:
# this is to invalidate old pickles
self.version = ENV_VERSION
+ # Build times -- to determine changed files
+ # Also use this as an inventory of all existing and built filenames.
self.mtimes = {} # filename -> mtime at the time of build
# File metadata
@@ -162,7 +164,6 @@ class BuildEnvironment:
# TOC inventory
self.titles = {} # filename -> title node
- # this also contains all existing filenames
self.tocs = {} # filename -> table of contents nodetree
self.toc_num_entries = {} # filename -> number of real entries
# used to determine when to show the TOC in a sidebar
@@ -199,7 +200,8 @@ class BuildEnvironment:
def clear_file(self, filename):
"""Remove all traces of a source file in the inventory."""
- if filename in self.titles:
+ if filename in self.mtimes:
+ self.mtimes.pop(filename, None)
self.titles.pop(filename, None)
self.tocs.pop(filename, None)
self.toctree_children.pop(filename, None)
@@ -584,7 +586,7 @@ class BuildEnvironment:
def check_consistency(self):
"""Do consistency checks."""
- for filename in self.titles:
+ for filename in self.mtimes:
if filename not in self.toctree_relations:
if filename == 'contents.rst':
# the master file is not included anywhere ;)