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
64cdb48c
Kaydet (Commit)
64cdb48c
authored
Kas 12, 2001
tarafından
Thomas Heller
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
No need to preprocess the header files - use ctags -I flag instead to
remove DL_IMPORT.
üst
bfeeeee8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
27 deletions
+15
-27
undoc_symbols.py
Doc/tools/undoc_symbols.py
+15
-27
No files found.
Doc/tools/undoc_symbols.py
Dosyayı görüntüle @
64cdb48c
"""This script prints out a list of undocumented symbols found in
Python include files, prefixed by their tag kind.
First, a temporary file is written which contains all Python include
files, with DL_IMPORT simply removed. This file is passed to ctags,
and the output is parsed into a dictionary mapping symbol names to tag
kinds.
Pass Python's include files to ctags, parse the output into a
dictionary mapping symbol names to tag kinds.
Then, the .tex files from Python docs are read into a giant string.
...
...
@@ -16,12 +14,14 @@ output, prefixed with their tag kind.
TAG_KINDS
=
"dpt"
# Doc sections to use
DOCSECTIONS
=
[
"api"
,
"ext"
]
DOCSECTIONS
=
[
"api"
]
# ["api"
, "ext"]
# Only print symbols starting with this prefix
# Only print symbols starting with this prefix
,
# to get all symbols, use an empty string
PREFIX
=
"Py"
INCLUDEPATTERN
=
"*.h"
# end of customization section
...
...
@@ -58,40 +58,28 @@ def findnames(file, prefix=""):
names
[
name
]
=
tag
return
names
def
print_undoc_symbols
(
prefix
):
incfile
=
tempfile
.
mktemp
(
".h"
)
fp
=
open
(
incfile
,
"w"
)
for
file
in
glob
.
glob
(
os
.
path
.
join
(
INCDIR
,
"*.h"
)):
text
=
open
(
file
)
.
read
()
# remove all DL_IMPORT, they will confuse ctags
text
=
re
.
sub
(
"DL_IMPORT"
,
""
,
text
)
fp
.
write
(
text
)
fp
.
close
()
def
print_undoc_symbols
(
prefix
,
docdir
,
incdir
):
docs
=
[]
for
sect
in
DOCSECTIONS
:
for
file
in
glob
.
glob
(
os
.
path
.
join
(
DOCDIR
,
sect
,
"*.tex"
)):
for
file
in
glob
.
glob
(
os
.
path
.
join
(
docdir
,
sect
,
"*.tex"
)):
docs
.
append
(
open
(
file
)
.
read
())
docs
=
"
\n
"
.
join
(
docs
)
fp
=
os
.
popen
(
"ctags --c-types=
%
s -f -
%
s"
%
(
TAG_KINDS
,
incfile
))
incfiles
=
os
.
path
.
join
(
incdir
,
INCLUDEPATTERN
)
fp
=
os
.
popen
(
"ctags -IDL_IMPORT --c-types=
%
s -f -
%
s"
%
(
TAG_KINDS
,
incfiles
))
dict
=
findnames
(
fp
,
prefix
)
names
=
dict
.
keys
()
names
.
sort
()
for
name
in
names
:
if
docs
.
find
(
name
)
==
-
1
:
print
dict
[
name
],
name
os
.
remove
(
incfile
)
if
__name__
==
'__main__'
:
global
INCDIR
global
DOCDIR
SRCDIR
=
os
.
path
.
dirname
(
sys
.
argv
[
0
])
INCDIR
=
os
.
path
.
normpath
(
os
.
path
.
join
(
SRCDIR
,
"../../Include"
))
DOCDIR
=
os
.
path
.
normpath
(
os
.
path
.
join
(
SRCDIR
,
".."
))
srcdir
=
os
.
path
.
dirname
(
sys
.
argv
[
0
])
incdir
=
os
.
path
.
normpath
(
os
.
path
.
join
(
srcdir
,
"../../Include"
))
docdir
=
os
.
path
.
normpath
(
os
.
path
.
join
(
srcdir
,
".."
))
print_undoc_symbols
(
PREFIX
)
print_undoc_symbols
(
PREFIX
,
docdir
,
incdir
)
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