Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
6daa33c8
Kaydet (Commit)
6daa33c8
authored
May 24, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #10818: Remove deprecated pydoc.serve() function
The pydoc module has a new enhanced web server.
üst
383c3fc6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
89 deletions
+6
-89
3.3.rst
Doc/whatsnew/3.3.rst
+3
-2
pydoc.py
Lib/pydoc.py
+0
-85
NEWS
Misc/NEWS
+3
-2
No files found.
Doc/whatsnew/3.3.rst
Dosyayı görüntüle @
6daa33c8
...
@@ -127,8 +127,9 @@ os
...
@@ -127,8 +127,9 @@ os
pydoc
pydoc
-----
-----
The Tk GUI has been removed from the :mod:`ssl` module: ``pydoc -g`` has been
The Tk GUI and the :func:`~pydoc.serve` function have been removed from the
deprecated in Python 3.2.
:mod:`pydoc` module: ``pydoc -g`` and :func:`~pydoc.serve` have been deprecated
in Python 3.2.
sys
sys
...
...
Lib/pydoc.py
Dosyayı görüntüle @
6daa33c8
...
@@ -2051,91 +2051,6 @@ def apropos(key):
...
@@ -2051,91 +2051,6 @@ def apropos(key):
warnings
.
filterwarnings
(
'ignore'
)
# ignore problems during import
warnings
.
filterwarnings
(
'ignore'
)
# ignore problems during import
ModuleScanner
()
.
run
(
callback
,
key
,
onerror
=
onerror
)
ModuleScanner
()
.
run
(
callback
,
key
,
onerror
=
onerror
)
# --------------------------------------------------- Web browser interface
def
serve
(
port
,
callback
=
None
,
completer
=
None
):
import
http.server
,
email
.
message
,
select
msg
=
'the pydoc.serve() function is deprecated'
warnings
.
warn
(
msg
,
DeprecationWarning
,
stacklevel
=
2
)
class
DocHandler
(
http
.
server
.
BaseHTTPRequestHandler
):
def
send_document
(
self
,
title
,
contents
):
try
:
self
.
send_response
(
200
)
self
.
send_header
(
'Content-Type'
,
'text/html; charset=UTF-8'
)
self
.
end_headers
()
self
.
wfile
.
write
(
html
.
page
(
title
,
contents
)
.
encode
(
'utf-8'
))
except
IOError
:
pass
def
do_GET
(
self
):
path
=
self
.
path
if
path
[
-
5
:]
==
'.html'
:
path
=
path
[:
-
5
]
if
path
[:
1
]
==
'/'
:
path
=
path
[
1
:]
if
path
and
path
!=
'.'
:
try
:
obj
=
locate
(
path
,
forceload
=
1
)
except
ErrorDuringImport
as
value
:
self
.
send_document
(
path
,
html
.
escape
(
str
(
value
)))
return
if
obj
:
self
.
send_document
(
describe
(
obj
),
html
.
document
(
obj
,
path
))
else
:
self
.
send_document
(
path
,
'no Python documentation found for
%
s'
%
repr
(
path
))
else
:
heading
=
html
.
heading
(
'<big><big><strong>Python: Index of Modules</strong></big></big>'
,
'#ffffff'
,
'#7799ee'
)
def
bltinlink
(
name
):
return
'<a href="
%
s.html">
%
s</a>'
%
(
name
,
name
)
names
=
[
x
for
x
in
sys
.
builtin_module_names
if
x
!=
'__main__'
]
contents
=
html
.
multicolumn
(
names
,
bltinlink
)
indices
=
[
'<p>'
+
html
.
bigsection
(
'Built-in Modules'
,
'#ffffff'
,
'#ee77aa'
,
contents
)]
seen
=
{}
for
dir
in
sys
.
path
:
indices
.
append
(
html
.
index
(
dir
,
seen
))
contents
=
heading
+
' '
.
join
(
indices
)
+
'''<p align=right>
<font color="#909090" face="helvetica, arial"><strong>
pydoc</strong> by Ka-Ping Yee <ping@lfw.org></font>'''
self
.
send_document
(
'Index of Modules'
,
contents
)
def
log_message
(
self
,
*
args
):
pass
class
DocServer
(
http
.
server
.
HTTPServer
):
def
__init__
(
self
,
port
,
callback
):
host
=
'localhost'
self
.
address
=
(
host
,
port
)
self
.
url
=
'http://
%
s:
%
d/'
%
(
host
,
port
)
self
.
callback
=
callback
self
.
base
.
__init__
(
self
,
self
.
address
,
self
.
handler
)
def
serve_until_quit
(
self
):
import
select
self
.
quit
=
False
while
not
self
.
quit
:
rd
,
wr
,
ex
=
select
.
select
([
self
.
socket
.
fileno
()],
[],
[],
1
)
if
rd
:
self
.
handle_request
()
self
.
server_close
()
def
server_activate
(
self
):
self
.
base
.
server_activate
(
self
)
if
self
.
callback
:
self
.
callback
(
self
)
DocServer
.
base
=
http
.
server
.
HTTPServer
DocServer
.
handler
=
DocHandler
DocHandler
.
MessageClass
=
email
.
message
.
Message
try
:
try
:
DocServer
(
port
,
callback
)
.
serve_until_quit
()
except
(
KeyboardInterrupt
,
select
.
error
):
pass
finally
:
if
completer
:
completer
()
# --------------------------------------- enhanced Web browser interface
# --------------------------------------- enhanced Web browser interface
def
_start_server
(
urlhandler
,
port
):
def
_start_server
(
urlhandler
,
port
):
...
...
Misc/NEWS
Dosyayı görüntüle @
6daa33c8
...
@@ -161,8 +161,9 @@ Core and Builtins
...
@@ -161,8 +161,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #10818: Remove the Tk GUI of the pydoc module (pydoc -g has been
- Issue #10818: Remove the Tk GUI and the serve() function of the pydoc module,
deprecated in Python 3.2).
pydoc -g has been deprecated in Python 3.2 and it has a new enhanced web
server.
- Issue #1441530: In imaplib, read the data in one chunk to speed up large
- Issue #1441530: In imaplib, read the data in one chunk to speed up large
reads and simplify code.
reads and simplify code.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment