Skip to content

Commit 4bf4041

Browse files
author
boris
committed
[2.7] Doc: Stop linking to non-existent pages.
1 parent 8d21aa2 commit 4bf4041

File tree

2 files changed

+124
-2
lines changed

2 files changed

+124
-2
lines changed

Doc/conf.py

Lines changed: 120 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,126 @@
8181
html_split_index = True
8282

8383
html_context = {
84-
'outdated': True
84+
'outdated': True,
85+
'moved_files': {
86+
'library/fpformat': None,
87+
'library/mutex': None,
88+
'library/new': None,
89+
'library/statvfs': None,
90+
'library/dircache': None,
91+
'library/macpath': None,
92+
'library/dbhash': None,
93+
'library/bsddb': None,
94+
# 'library/someos': 'library/index',
95+
'library/someos': None,
96+
# 'library/popen2': 'library/subprocess',
97+
'library/popen2': None,
98+
# 'library/mhlib': 'library/mailbox',
99+
'library/mhlib': None,
100+
# 'library/mimetools': 'library/email',
101+
'library/mimetools': None,
102+
# 'library/mimewriter': 'library/email',
103+
'library/mimewriter': None,
104+
# 'library/mimify': 'library/email',
105+
'library/mimify': None,
106+
# 'library/multifile': 'library/email',
107+
'library/multifile': None,
108+
'library/sgmllib': None,
109+
'library/imageop': None,
110+
# 'library/hotshot': 'library/profile',
111+
'library/hotshot': None,
112+
'library/future_builtins': None,
113+
'library/user': None,
114+
'library/fpectl': None,
115+
'library/restricted': None,
116+
'library/rexec': None,
117+
'library/bastion': None,
118+
'library/imputil': None,
119+
'library/compiler': None,
120+
# 'library/dl': 'library/ctypes',
121+
'library/dl': None,
122+
'library/posixfile': None,
123+
# 'library/commands': 'library/subprocess',
124+
'library/commands': None,
125+
'library/mac': None,
126+
'library/ic': None,
127+
'library/macos': None,
128+
'library/macostools': None,
129+
'library/easydialogs': None,
130+
'library/framework': None,
131+
'library/autogil': None,
132+
'library/carbon': None,
133+
'library/colorpicker': None,
134+
'library/macosa': None,
135+
'library/gensuitemodule': None,
136+
'library/aetools': None,
137+
'library/aepack': None,
138+
'library/aetypes': None,
139+
'library/miniaeframe': None,
140+
'library/sgi': None,
141+
'library/al': None,
142+
'library/cd': None,
143+
'library/fl': None,
144+
'library/fm': None,
145+
'library/gl': None,
146+
'library/imgfile': None,
147+
'library/jpeg': None,
148+
'library/sun': None,
149+
'library/sunaudio': None,
150+
# 'c-api/int': 'c-api/long',
151+
'c-api/int': None,
152+
# 'c-api/string': 'c-api/bytes',
153+
'c-api/string': None,
154+
'c-api/class': None,
155+
# 'c-api/cobject': 'c-api/capsule',
156+
'c-api/cobject': None,
157+
'howto/doanddont': None,
158+
'howto/webservers': None,
159+
'library/strings': 'library/text',
160+
'library/stringio': ('library/io', 'io.StringIO'),
161+
# 'library/sets': ('library/stdtypes', 'set'),
162+
# 'library/sets': ('library/stdtypes', 'set-types-set-frozenset'),
163+
'library/sets': None,
164+
'library/userdict': ('library/collections', 'userdict-objects'),
165+
'library/repr': 'library/reprlib',
166+
'library/copy_reg': 'library/copyreg',
167+
'library/anydbm': 'library/dbm',
168+
'library/whichdb': ('library/dbm', 'dbm.whichdb'),
169+
'library/dumbdbm': ('library/dbm', 'module-dbm.dumb'),
170+
'library/dbm': ('library/dbm', 'module-dbm.ndbm'),
171+
'library/gdbm': ('library/dbm', 'module-dbm.gnu'),
172+
'library/robotparser': 'library/urllib.robotparser',
173+
# 'library/md5': 'library/hashlib',
174+
'library/md5': None,
175+
# 'library/sha': 'library/hashlib',
176+
'library/sha': None,
177+
'library/thread': 'library/_thread',
178+
# Renamed to _dummy_thread but has since been removed completely
179+
# 'library/dummy_thread': 'library/_dummy_thread',
180+
'library/dummy_thread': None,
181+
'library/email-examples': 'library/email.examples',
182+
# 'library/rfc822': 'library/email',
183+
'library/rfc822': None,
184+
'library/htmlparser': 'library/html.parser',
185+
'library/htmllib': None,
186+
# 'library/urllib2': 'library/urllib',
187+
'library/urllib2': 'library/urllib.request',
188+
'library/httplib': 'library/http.client',
189+
'library/urlparse': 'library/urllib.parse',
190+
'library/basehttpserver': 'library/http.server',
191+
'library/simplehttpserver': ('library/http.server', 'http.server.SimpleHTTPRequestHandler'),
192+
'library/cgihttpserver': ('library/http.server', 'http.server.CGIHTTPRequestHandler'),
193+
'library/cookielib': 'library/http.cookiejar',
194+
'library/cookie': 'library/http.cookies',
195+
'library/xmlrpclib': 'library/xmlrpc.client',
196+
'library/simplexmlrpcserver': 'library/xmlrpc.server',
197+
'library/docxmlrpcserver': ('library/xmlrpc.server', 'documenting-xmlrpc-server'),
198+
'library/ttk': 'library/tkinter.ttk',
199+
'library/tix': 'library/tkinter.tix',
200+
'library/scrolledtext': 'library/tkinter.scrolledtext',
201+
'library/__builtin__': 'library/builtins',
202+
'library/_winreg': 'library/winreg',
203+
},
85204
}
86205

87206

Doc/tools/templates/layout.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
<div id="outdated-warning" style="padding: .5em; text-align: center; background-color: #FFBABA; color: #6A0E0E;">
55
{% trans %}This document is for an old version of Python that is {% endtrans %}<a href="https://devguide.python.org/devcycle/#end-of-life-branches">{% trans %}no longer supported{% endtrans %}</a>.
66
{% trans %}You should upgrade and read the {% endtrans %}
7-
<a href="https://docs.python.org/{{ language + '/' if language and language != 'en' else '' }}3/{{ pagename }}{{ file_suffix }}">{% trans %} Python documentation for the current stable release{% endtrans %}</a>.
7+
{% set new_link = moved_files.get(pagename, pagename) %}
8+
{% set new_pagename, new_fragment = (new_link, None) if (new_link is string or new_link is none) else new_link %}
9+
{% set new_pagename = new_pagename if new_pagename else 'index' %}
10+
<a href="https://docs.python.org/{{ language + '/' if language and language != 'en' else '' }}3/{{ new_pagename }}{{ file_suffix }}{{ '#' + new_fragment if new_fragment else '' }}">{% trans %} Python documentation for the current stable release{% endtrans %}</a>.
811
</div>
912
{%- endif %}
1013
{% endblock %}

0 commit comments

Comments
 (0)