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
895e8925
Kaydet (Commit)
895e8925
authored
Mar 01, 2001
tarafından
Ka-Ping Yee
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Call main routine in pydoc module (pydoc.cli).
üst
1d384634
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
76 deletions
+2
-76
pydoc
Tools/scripts/pydoc
+2
-76
No files found.
Tools/scripts/pydoc
Dosyayı görüntüle @
895e8925
#!/usr/bin/env python
#!/usr/bin/env python
# -------------------------------------------------- command-line interface
import
pydoc
pydoc
.
cli
()
import
sys
,
os
,
pydoc
from
string
import
lower
if
__name__
==
'__main__'
:
import
getopt
class
BadUsage
:
pass
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'k:p:w'
)
writing
=
0
for
opt
,
val
in
opts
:
if
opt
==
'-k'
:
pydoc
.
apropos
(
lower
(
val
))
break
if
opt
==
'-p'
:
try
:
port
=
int
(
val
)
except
ValueError
:
raise
BadUsage
def
ready
(
port
=
port
):
print
'server ready at http://127.0.0.1:
%
d/'
%
port
pydoc
.
serve
((
'127.0.0.1'
,
port
),
ready
)
break
if
opt
==
'-w'
:
if
not
args
:
raise
BadUsage
writing
=
1
else
:
if
args
:
for
arg
in
args
:
try
:
if
os
.
path
.
isfile
(
arg
):
arg
=
pydoc
.
importfile
(
arg
)
if
writing
:
if
os
.
path
.
isdir
(
arg
):
pydoc
.
writedocs
(
arg
)
else
:
pydoc
.
writedoc
(
arg
)
else
:
pydoc
.
man
(
arg
)
except
pydoc
.
DocImportError
,
value
:
print
'problem in
%
s -
%
s'
%
(
value
.
filename
,
value
.
args
)
else
:
if
sys
.
platform
in
[
'mac'
,
'win'
,
'win32'
,
'nt'
]:
# GUI platforms with threading
import
threading
ready
=
threading
.
Event
()
address
=
(
'127.0.0.1'
,
12346
)
threading
.
Thread
(
target
=
pydoc
.
serve
,
args
=
(
address
,
ready
.
set
))
.
start
()
ready
.
wait
()
import
webbrowser
webbrowser
.
open
(
'http://127.0.0.1:12346/'
)
else
:
raise
BadUsage
except
(
getopt
.
error
,
BadUsage
):
print
"""
%
s <name> ...
Show documentation on something.
<name> may be the name of a Python function, module, or package,
or a dotted reference to a class or function within a module or
module in a package, or the filename of a Python module to import.
%
s -k <keyword>
Search for a keyword in the synopsis lines of all modules.
%
s -p <port>
Start an HTTP server on the given port on the local machine.
%
s -w <module> ...
Write out the HTML documentation for a module to a file.
%
s -w <moduledir>
Write out the HTML documentation for all modules in the tree
under a given directory to files in the current directory.
"""
%
((
sys
.
argv
[
0
],)
*
5
)
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