summaryrefslogtreecommitdiff
path: root/sphinx/builders/websupport.py
diff options
context:
space:
mode:
authorDaniel Neuhäuser <ich@danielneuhaeuser.de>2010-08-14 14:43:54 +0200
committerDaniel Neuhäuser <ich@danielneuhaeuser.de>2010-08-14 14:43:54 +0200
commit6f91352415b0880e1b09f5c87468785b41ab38f7 (patch)
treed4bc027831e128a3f0af68debd1abe1eab3ca571 /sphinx/builders/websupport.py
parent54f3323ac78582d11422293ecab3b5c2e5d3dd4b (diff)
downloadsphinx-git-6f91352415b0880e1b09f5c87468785b41ab38f7.tar.gz
Take doctrees in subdirectories into account
Diffstat (limited to 'sphinx/builders/websupport.py')
-rw-r--r--sphinx/builders/websupport.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/sphinx/builders/websupport.py b/sphinx/builders/websupport.py
index 5f27b9074..ac9dd7152 100644
--- a/sphinx/builders/websupport.py
+++ b/sphinx/builders/websupport.py
@@ -12,7 +12,6 @@
import cPickle as pickle
from os import path
from cgi import escape
-from glob import glob
import os
import posixpath
import shutil
@@ -38,8 +37,11 @@ class WebSupportBuilder(StandaloneHTMLBuilder):
def init(self):
StandaloneHTMLBuilder.init(self)
- for f in glob(path.join(self.doctreedir, '*.doctree')):
- copyfile(f, f + '.old')
+ for root, dirs, files in os.walk(self.doctreedir):
+ for fn in files:
+ fp = path.join(root, fn)
+ if fp.endswith('.doctree'):
+ copyfile(fp, fp + '.old')
def init_translator_class(self):
self.translator_class = WebSupportTranslator
@@ -160,8 +162,11 @@ class WebSupportBuilder(StandaloneHTMLBuilder):
except IOError:
# in case any of these directories don't exist
pass
- for f in glob(path.join(self.doctreedir, '*.doctree.old')):
- os.remove(f)
+ for root, dirs, files in os.walk(self.doctreedir):
+ for fn in files:
+ fp = path.join(root, fn)
+ if fp.endswith('.doctree.old'):
+ os.remove(fp)
def dump_search_index(self):
self.indexer.finish_indexing()