Kaydet (Commit) 5617db86 authored tarafından Georg Brandl's avatar Georg Brandl

Merged revisions 71960 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r71960 | georg.brandl | 2009-04-26 11:56:44 +0200 (So, 26 Apr 2009) | 1 line

  Move pydoc_topics module to its own subdirectory, so that no generated code is in Lib/.
........
üst 4e869c7e
...@@ -28,6 +28,7 @@ help: ...@@ -28,6 +28,7 @@ help:
@echo " coverage to check documentation coverage for library and C API" @echo " coverage to check documentation coverage for library and C API"
@echo " dist to create a \"dist\" directory with archived docs for download" @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: checkout:
@if [ ! -d tools/sphinx ]; then \ @if [ ! -d tools/sphinx ]; then \
echo "Checking out Sphinx..."; \ echo "Checking out Sphinx..."; \
...@@ -101,8 +102,8 @@ doctest: build ...@@ -101,8 +102,8 @@ doctest: build
pydoc-topics: BUILDER = pydoc-topics pydoc-topics: BUILDER = pydoc-topics
pydoc-topics: build pydoc-topics: build
@echo "Building finished; now copy build/pydoc-topics/pydoc_topics.py " \ @echo "Building finished; now copy build/pydoc-topics/topics.py " \
"into the Lib/ directory" "to Lib/pydoc_data/topics.py"
htmlview: html htmlview: html
$(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')" $(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')"
...@@ -132,7 +133,7 @@ dist: ...@@ -132,7 +133,7 @@ dist:
(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-text.zip python-$(DISTVERSION)-docs-text) (cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-text.zip python-$(DISTVERSION)-docs-text)
rm -r dist/python-$(DISTVERSION)-docs-text rm -r dist/python-$(DISTVERSION)-docs-text
rm dist/python-$(DISTVERSION)-docs-text.tar rm dist/python-$(DISTVERSION)-docs-text.tar
# archive the A4 latex # archive the A4 latex
-rm -r build/latex -rm -r build/latex
make latex PAPER=a4 make latex PAPER=a4
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
Sphinx extension with Python doc-specific markup. Sphinx extension with Python doc-specific markup.
:copyright: 2008 by Georg Brandl. :copyright: 2008, 2009 by Georg Brandl.
:license: Python license. :license: Python license.
""" """
...@@ -87,7 +87,7 @@ class PydocTopicsBuilder(Builder): ...@@ -87,7 +87,7 @@ class PydocTopicsBuilder(Builder):
self.topics[label] = str(writer.output) self.topics[label] = str(writer.output)
def finish(self): def finish(self):
f = open(path.join(self.outdir, 'pydoc_topics.py'), 'w') f = open(path.join(self.outdir, 'topics.py'), 'w')
try: try:
f.write('# Autogenerated by Sphinx on %s\n' % asctime()) f.write('# Autogenerated by Sphinx on %s\n' % asctime())
f.write('topics = ' + pformat(self.topics) + '\n') f.write('topics = ' + pformat(self.topics) + '\n')
......
...@@ -1530,11 +1530,11 @@ class Helper: ...@@ -1530,11 +1530,11 @@ class Helper:
# These dictionaries map a topic name to either an alias, or a tuple # These dictionaries map a topic name to either an alias, or a tuple
# (label, seealso-items). The "label" is the label of the corresponding # (label, seealso-items). The "label" is the label of the corresponding
# section in the .rst file under Doc/ and an index into the dictionary # 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 # CAUTION: if you change one of these dictionaries, be sure to adapt the
# list of needed labels in Doc/tools/sphinxext/pyspecific.py and # 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 # make pydoc-topics
# in Doc/ and copying the output file into the Lib/ directory. # in Doc/ and copying the output file into the Lib/ directory.
...@@ -1809,11 +1809,11 @@ Here is a list of available topics. Enter any topic name to get more help. ...@@ -1809,11 +1809,11 @@ Here is a list of available topics. Enter any topic name to get more help.
def showtopic(self, topic, more_xrefs=''): def showtopic(self, topic, more_xrefs=''):
try: try:
import pydoc_topics import pydoc_data.topics
except ImportError: except ImportError:
self.output.write(''' self.output.write('''
Sorry, topic and keyword documentation is not available because the 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 return
target = self.topics.get(topic, self.keywords.get(topic)) target = self.topics.get(topic, self.keywords.get(topic))
...@@ -1825,7 +1825,7 @@ module "pydoc_topics" could not be found. ...@@ -1825,7 +1825,7 @@ module "pydoc_topics" could not be found.
label, xrefs = target label, xrefs = target
try: try:
doc = pydoc_topics.topics[label] doc = pydoc_data.topics.topics[label]
except KeyError: except KeyError:
self.output.write('no documentation found for %s\n' % repr(topic)) self.output.write('no documentation found for %s\n' % repr(topic))
return return
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment