Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5617db8

Browse files
committed
Merged revisions 71960 via svnmerge from
svn+ssh://[email protected]/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/. ........
1 parent 4e869c7 commit 5617db8

6 files changed

Lines changed: 94 additions & 88 deletions

File tree

Doc/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ help:
2828
@echo " coverage to check documentation coverage for library and C API"
2929
@echo " dist to create a \"dist\" directory with archived docs for download"
3030

31+
# Note: if you update versions here, do the same in make.bat and README.txt
3132
checkout:
3233
@if [ ! -d tools/sphinx ]; then \
3334
echo "Checking out Sphinx..."; \
@@ -101,8 +102,8 @@ doctest: build
101102

102103
pydoc-topics: BUILDER = pydoc-topics
103104
pydoc-topics: build
104-
@echo "Building finished; now copy build/pydoc-topics/pydoc_topics.py " \
105-
"into the Lib/ directory"
105+
@echo "Building finished; now copy build/pydoc-topics/topics.py " \
106+
"to Lib/pydoc_data/topics.py"
106107

107108
htmlview: html
108109
$(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')"
@@ -132,7 +133,7 @@ dist:
132133
(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-text.zip python-$(DISTVERSION)-docs-text)
133134
rm -r dist/python-$(DISTVERSION)-docs-text
134135
rm dist/python-$(DISTVERSION)-docs-text.tar
135-
136+
136137
# archive the A4 latex
137138
-rm -r build/latex
138139
make latex PAPER=a4

Doc/tools/sphinxext/pyspecific.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Sphinx extension with Python doc-specific markup.
77
8-
:copyright: 2008 by Georg Brandl.
8+
:copyright: 2008, 2009 by Georg Brandl.
99
:license: Python license.
1010
"""
1111

@@ -87,7 +87,7 @@ def write(self, *ignored):
8787
self.topics[label] = str(writer.output)
8888

8989
def finish(self):
90-
f = open(path.join(self.outdir, 'pydoc_topics.py'), 'w')
90+
f = open(path.join(self.outdir, 'topics.py'), 'w')
9191
try:
9292
f.write('# Autogenerated by Sphinx on %s\n' % asctime())
9393
f.write('topics = ' + pformat(self.topics) + '\n')

Lib/pydoc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,11 +1530,11 @@ class Helper:
15301530
# These dictionaries map a topic name to either an alias, or a tuple
15311531
# (label, seealso-items). The "label" is the label of the corresponding
15321532
# section in the .rst file under Doc/ and an index into the dictionary
1533-
# in pydoc_topics.py.
1533+
# in pydoc_data/topics.py.
15341534
#
15351535
# CAUTION: if you change one of these dictionaries, be sure to adapt the
15361536
# list of needed labels in Doc/tools/sphinxext/pyspecific.py and
1537-
# regenerate the pydoc_topics.py file by running
1537+
# regenerate the pydoc_data/topics.py file by running
15381538
# make pydoc-topics
15391539
# in Doc/ and copying the output file into the Lib/ directory.
15401540

@@ -1809,11 +1809,11 @@ def listtopics(self):
18091809

18101810
def showtopic(self, topic, more_xrefs=''):
18111811
try:
1812-
import pydoc_topics
1812+
import pydoc_data.topics
18131813
except ImportError:
18141814
self.output.write('''
18151815
Sorry, topic and keyword documentation is not available because the
1816-
module "pydoc_topics" could not be found.
1816+
module "pydoc_data.topics" could not be found.
18171817
''')
18181818
return
18191819
target = self.topics.get(topic, self.keywords.get(topic))
@@ -1825,7 +1825,7 @@ def showtopic(self, topic, more_xrefs=''):
18251825

18261826
label, xrefs = target
18271827
try:
1828-
doc = pydoc_topics.topics[label]
1828+
doc = pydoc_data.topics.topics[label]
18291829
except KeyError:
18301830
self.output.write('no documentation found for %s\n' % repr(topic))
18311831
return

Lib/pydoc_data/__init__.py

Whitespace-only changes.

Lib/pydoc_data/topics.py

Lines changed: 83 additions & 0 deletions
Large diffs are not rendered by default.

Lib/pydoc_topics.py

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)