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
3764b6b6
Kaydet (Commit)
3764b6b6
authored
24 years ago
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix the way we found relevant cfuncdesc lines; PREFIX was not a regular
expression!
üst
7f58e2ec
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
anno-api.py
Doc/tools/anno-api.py
+10
-7
No files found.
Doc/tools/anno-api.py
Dosyayı görüntüle @
3764b6b6
...
@@ -4,13 +4,13 @@ __version__ = '$Revision$'
...
@@ -4,13 +4,13 @@ __version__ = '$Revision$'
import
getopt
import
getopt
import
os
import
os
import
string
import
sys
import
sys
import
refcounts
import
refcounts
PREFIX
=
r"\begin{cfuncdesc}{Py(Var|)Object*}{"
PREFIX_1
=
r"\begin{cfuncdesc}{PyObject*}{"
PREFIX_2
=
r"\begin{cfuncdesc}{PyVarObject*}{"
def
main
():
def
main
():
...
@@ -30,8 +30,6 @@ def main():
...
@@ -30,8 +30,6 @@ def main():
output
=
open
(
outfile
,
"w"
)
output
=
open
(
outfile
,
"w"
)
if
not
args
:
if
not
args
:
args
=
[
"-"
]
args
=
[
"-"
]
prefix
=
PREFIX
prefix_len
=
len
(
prefix
)
for
infile
in
args
:
for
infile
in
args
:
if
infile
==
"-"
:
if
infile
==
"-"
:
input
=
sys
.
stdin
input
=
sys
.
stdin
...
@@ -41,8 +39,13 @@ def main():
...
@@ -41,8 +39,13 @@ def main():
line
=
input
.
readline
()
line
=
input
.
readline
()
if
not
line
:
if
not
line
:
break
break
if
line
[:
prefix_len
]
==
prefix
:
prefix
=
None
s
=
string
.
split
(
line
[
prefix_len
:],
'}'
,
1
)[
0
]
if
line
.
startswith
(
PREFIX_1
):
prefix
=
PREFIX_1
elif
line
.
startswith
(
PREFIX_2
):
prefix
=
PREFIX_2
if
prefix
:
s
=
line
[
len
(
prefix
):]
.
split
(
'}'
,
1
)[
0
]
try
:
try
:
info
=
rcdict
[
s
]
info
=
rcdict
[
s
]
except
KeyError
:
except
KeyError
:
...
@@ -56,7 +59,7 @@ def main():
...
@@ -56,7 +59,7 @@ def main():
rc
=
rc
+
" reference"
rc
=
rc
+
" reference"
line
=
(
r"\begin{cfuncdesc}[
%
s]{
%
s}{"
line
=
(
r"\begin{cfuncdesc}[
%
s]{
%
s}{"
%
(
rc
,
info
.
result_type
))
\
%
(
rc
,
info
.
result_type
))
\
+
line
[
prefix_len
:]
+
line
[
len
(
prefix
)
:]
output
.
write
(
line
)
output
.
write
(
line
)
if
infile
!=
"-"
:
if
infile
!=
"-"
:
input
.
close
()
input
.
close
()
...
...
This diff is collapsed.
Click to expand it.
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