Move pydoc_topics module to its own subdirectory, so that no generated code is in Lib/.
diff --git a/Doc/Makefile b/Doc/Makefile
index 46abe51..c9f3ed6 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -28,8 +28,8 @@
@echo " coverage to check documentation coverage for library and C API"
@echo " dist to create a \"dist\" directory with archived docs for download"
+# Note: if you update versions here, do the same in make.bat and README.txt
checkout:
- # Note: if you update versions here, do the same in make.bat and README.txt
@if [ ! -d tools/sphinx ]; then \
echo "Checking out Sphinx..."; \
svn checkout $(SVNROOT)/external/Sphinx-0.6.1/sphinx tools/sphinx; \
@@ -102,8 +102,8 @@
pydoc-topics: BUILDER = pydoc-topics
pydoc-topics: build
- @echo "Building finished; now copy build/pydoc-topics/pydoc_topics.py " \
- "into the Lib/ directory"
+ @echo "Building finished; now copy build/pydoc-topics/topics.py " \
+ "to Lib/pydoc_data/topics.py"
htmlview: html
$(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')"
@@ -133,7 +133,7 @@
(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-text.zip python-$(DISTVERSION)-docs-text)
rm -r dist/python-$(DISTVERSION)-docs-text
rm dist/python-$(DISTVERSION)-docs-text.tar
-
+
# archive the A4 latex
-rm -r build/latex
make latex PAPER=a4
diff --git a/Doc/tools/sphinxext/pyspecific.py b/Doc/tools/sphinxext/pyspecific.py
index f00a899..402a9a1 100644
--- a/Doc/tools/sphinxext/pyspecific.py
+++ b/Doc/tools/sphinxext/pyspecific.py
@@ -5,7 +5,7 @@
Sphinx extension with Python doc-specific markup.
- :copyright: 2008 by Georg Brandl.
+ :copyright: 2008, 2009 by Georg Brandl.
:license: Python license.
"""
@@ -89,7 +89,7 @@
self.topics[label] = writer.output
def finish(self):
- f = open(path.join(self.outdir, 'pydoc_topics.py'), 'w')
+ f = open(path.join(self.outdir, 'topics.py'), 'w')
try:
f.write('# Autogenerated by Sphinx on %s\n' % asctime())
f.write('topics = ' + pformat(self.topics) + '\n')
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 3afb981..a70f016 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1533,11 +1533,11 @@
# These dictionaries map a topic name to either an alias, or a tuple
# (label, seealso-items). The "label" is the label of the corresponding
# section in the .rst file under Doc/ and an index into the dictionary
- # in pydoc_topics.py.
+ # in pydoc_data/topics.py.
#
# CAUTION: if you change one of these dictionaries, be sure to adapt the
# list of needed labels in Doc/tools/sphinxext/pyspecific.py and
- # regenerate the pydoc_topics.py file by running
+ # regenerate the pydoc_data/topics.py file by running
# make pydoc-topics
# in Doc/ and copying the output file into the Lib/ directory.
@@ -1821,11 +1821,11 @@
def showtopic(self, topic, more_xrefs=''):
try:
- import pydoc_topics
+ import pydoc_data.topics
except ImportError:
self.output.write('''
Sorry, topic and keyword documentation is not available because the
-module "pydoc_topics" could not be found.
+module "pydoc_data.topics" could not be found.
''')
return
target = self.topics.get(topic, self.keywords.get(topic))
@@ -1837,7 +1837,7 @@
label, xrefs = target
try:
- doc = pydoc_topics.topics[label]
+ doc = pydoc_data.topics.topics[label]
except KeyError:
self.output.write('no documentation found for %s\n' % repr(topic))
return
diff --git a/Lib/pydoc_data/__init__.py b/Lib/pydoc_data/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Lib/pydoc_data/__init__.py
diff --git a/Lib/pydoc_topics.py b/Lib/pydoc_data/topics.py
similarity index 100%
rename from Lib/pydoc_topics.py
rename to Lib/pydoc_data/topics.py