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
0b7b4b8a
Kaydet (Commit)
0b7b4b8a
authored
Eyl 18, 2000
tarafından
Jeremy Hylton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
satisfy the tabnanny
üst
9082cdd0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
35 deletions
+36
-35
eptags.py
Tools/scripts/eptags.py
+15
-14
parseentities.py
Tools/scripts/parseentities.py
+21
-21
trace.py
Tools/scripts/trace.py
+0
-0
No files found.
Tools/scripts/eptags.py
Dosyayı görüntüle @
0b7b4b8a
...
...
@@ -24,32 +24,33 @@ matcher = re.compile(expr)
def
treat_file
(
file
,
outfp
):
"""Append tags found in file named 'file' to the open file 'outfp'"""
try
:
fp
=
open
(
file
,
'r'
)
fp
=
open
(
file
,
'r'
)
except
:
sys
.
stderr
.
write
(
'Cannot open
%
s
\n
'
%
file
)
return
sys
.
stderr
.
write
(
'Cannot open
%
s
\n
'
%
file
)
return
charno
=
0
lineno
=
0
tags
=
[]
size
=
0
while
1
:
line
=
fp
.
readline
()
if
not
line
:
break
lineno
=
lineno
+
1
m
=
matcher
.
search
(
line
)
if
m
:
tag
=
m
.
group
(
0
)
+
'
\177
%
d,
%
d
\n
'
%
(
lineno
,
charno
)
tags
.
append
(
tag
)
size
=
size
+
len
(
tag
)
charno
=
charno
+
len
(
line
)
line
=
fp
.
readline
()
if
not
line
:
break
lineno
=
lineno
+
1
m
=
matcher
.
search
(
line
)
if
m
:
tag
=
m
.
group
(
0
)
+
'
\177
%
d,
%
d
\n
'
%
(
lineno
,
charno
)
tags
.
append
(
tag
)
size
=
size
+
len
(
tag
)
charno
=
charno
+
len
(
line
)
outfp
.
write
(
'
\f\n
%
s,
%
d
\n
'
%
(
file
,
size
))
for
tag
in
tags
:
outfp
.
write
(
tag
)
outfp
.
write
(
tag
)
def
main
():
outfp
=
open
(
'TAGS'
,
'w'
)
for
file
in
sys
.
argv
[
1
:]:
treat_file
(
file
,
outfp
)
treat_file
(
file
,
outfp
)
if
__name__
==
"__main__"
:
main
()
Tools/scripts/parseentities.py
Dosyayı görüntüle @
0b7b4b8a
...
...
@@ -21,15 +21,15 @@ def parse(text,pos=0,endpos=None):
pos
=
0
if
endpos
is
None
:
endpos
=
len
(
text
)
endpos
=
len
(
text
)
d
=
{}
while
1
:
m
=
entityRE
.
search
(
text
,
pos
,
endpos
)
if
not
m
:
break
name
,
charcode
,
comment
=
m
.
groups
()
d
[
name
]
=
charcode
,
comment
pos
=
m
.
end
()
m
=
entityRE
.
search
(
text
,
pos
,
endpos
)
if
not
m
:
break
name
,
charcode
,
comment
=
m
.
groups
()
d
[
name
]
=
charcode
,
comment
pos
=
m
.
end
()
return
d
def
writefile
(
f
,
defs
):
...
...
@@ -38,27 +38,27 @@ def writefile(f,defs):
items
=
defs
.
items
()
items
.
sort
()
for
name
,(
charcode
,
comment
)
in
items
:
if
charcode
[:
2
]
==
'&#'
:
code
=
int
(
charcode
[
2
:
-
1
])
if
code
<
256
:
charcode
=
"'
\
%
o'"
%
code
else
:
charcode
=
repr
(
charcode
)
else
:
charcode
=
repr
(
charcode
)
comment
=
TextTools
.
collapse
(
comment
)
f
.
write
(
" '
%
s':
\t
%
s,
\t
#
%
s
\n
"
%
(
name
,
charcode
,
comment
))
if
charcode
[:
2
]
==
'&#'
:
code
=
int
(
charcode
[
2
:
-
1
])
if
code
<
256
:
charcode
=
"'
\
%
o'"
%
code
else
:
charcode
=
repr
(
charcode
)
else
:
charcode
=
repr
(
charcode
)
comment
=
TextTools
.
collapse
(
comment
)
f
.
write
(
" '
%
s':
\t
%
s,
\t
#
%
s
\n
"
%
(
name
,
charcode
,
comment
))
f
.
write
(
'
\n
}
\n
'
)
if
__name__
==
'__main__'
:
if
len
(
sys
.
argv
)
>
1
:
infile
=
open
(
sys
.
argv
[
1
])
infile
=
open
(
sys
.
argv
[
1
])
else
:
infile
=
sys
.
stdin
infile
=
sys
.
stdin
if
len
(
sys
.
argv
)
>
2
:
outfile
=
open
(
sys
.
argv
[
2
],
'w'
)
outfile
=
open
(
sys
.
argv
[
2
],
'w'
)
else
:
outfile
=
sys
.
stdout
outfile
=
sys
.
stdout
text
=
infile
.
read
()
defs
=
parse
(
text
)
writefile
(
outfile
,
defs
)
...
...
Tools/scripts/trace.py
Dosyayı görüntüle @
0b7b4b8a
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