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
071972e4
Kaydet (Commit)
071972e4
authored
Eki 16, 2002
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use string methods.
üst
06912b77
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
23 deletions
+18
-23
buildindex.py
Doc/tools/buildindex.py
+3
-3
indfix.py
Doc/tools/indfix.py
+2
-3
keywords.py
Doc/tools/keywords.py
+2
-3
refcounts.py
Doc/tools/refcounts.py
+3
-4
rewrite.py
Doc/tools/rewrite.py
+5
-6
support.py
Doc/tools/support.py
+1
-2
toc2bkm.py
Doc/tools/toc2bkm.py
+2
-2
No files found.
Doc/tools/buildindex.py
Dosyayı görüntüle @
071972e4
...
...
@@ -2,7 +2,7 @@
__version__
=
'$Revision$'
import
os
import
os
.path
import
re
import
string
import
sys
...
...
@@ -49,7 +49,7 @@ class Node:
def
dump
(
self
):
return
"
%
s
\1
%
s###
%
s
\n
"
\
%
(
string
.
join
(
self
.
links
,
"
\1
"
),
%
(
"
\1
"
.
join
(
self
.
links
),
bang_join
(
self
.
text
),
self
.
seqno
)
...
...
@@ -294,7 +294,7 @@ def format_html_letters(nodes, columns, group_symbol_nodes):
for
letter
,
nodes
in
letter_groups
:
s
=
"<b><a href=
\"
#letter-
%
s
\"
>
%
s</a></b>"
%
(
letter
,
letter
)
items
.
append
(
s
)
s
=
[
"<hr><center>
\n
%
s</center>
\n
"
%
string
.
join
(
items
,
" |
\n
"
)]
s
=
[
"<hr><center>
\n
%
s</center>
\n
"
%
" |
\n
"
.
join
(
items
)]
for
letter
,
nodes
in
letter_groups
:
s
.
append
(
format_letter
(
letter
))
s
.
append
(
format_nodes
(
nodes
,
columns
))
...
...
Doc/tools/indfix.py
Dosyayı görüntüle @
071972e4
...
...
@@ -19,13 +19,12 @@ isn't part of a group of similar items is not modified.
__version__
=
'$Revision$'
import
re
import
string
import
StringIO
import
sys
def
cmp_entries
(
e1
,
e2
,
lower
=
string
.
lower
):
return
cmp
(
lower
(
e1
[
1
]),
lower
(
e2
[
1
]
))
or
cmp
(
e1
,
e2
)
def
cmp_entries
(
e1
,
e2
):
return
cmp
(
e1
[
1
]
.
lower
(),
e2
[
1
]
.
lower
(
))
or
cmp
(
e1
,
e2
)
def
dump_entries
(
write
,
entries
):
...
...
Doc/tools/keywords.py
Dosyayı görüntüle @
071972e4
...
...
@@ -2,11 +2,10 @@
# This Python program sorts and reformats the table of keywords in ref2.tex
import
string
l
=
[]
try
:
while
1
:
l
=
l
+
string
.
split
(
raw_input
()
)
l
=
l
+
raw_input
()
.
split
(
)
except
EOFError
:
pass
l
.
sort
()
...
...
@@ -16,5 +15,5 @@ ncols = 5
nrows
=
(
len
(
l
)
+
ncols
-
1
)
/
ncols
for
i
in
range
(
nrows
):
for
j
in
range
(
i
,
len
(
l
),
nrows
):
print
string
.
ljust
(
l
[
j
],
10
),
print
l
[
j
]
.
ljust
(
10
),
print
Doc/tools/refcounts.py
Dosyayı görüntüle @
071972e4
...
...
@@ -2,7 +2,6 @@
__version__
=
'$Revision$'
import
os
import
string
import
sys
...
...
@@ -10,7 +9,7 @@ import sys
try
:
p
=
os
.
path
.
dirname
(
__file__
)
except
NameError
:
p
=
sys
.
path
[
0
]
p
=
os
.
path
.
dirname
(
sys
.
argv
[
0
])
p
=
os
.
path
.
normpath
(
os
.
path
.
join
(
os
.
getcwd
(),
p
,
os
.
pardir
,
"api"
,
"refcounts.dat"
))
DEFAULT_PATH
=
p
...
...
@@ -27,11 +26,11 @@ def loadfile(fp):
line
=
fp
.
readline
()
if
not
line
:
break
line
=
string
.
strip
(
line
)
line
=
line
.
strip
(
)
if
line
[:
1
]
in
(
""
,
"#"
):
# blank lines and comments
continue
parts
=
string
.
split
(
line
,
":"
,
4
)
parts
=
line
.
split
(
":"
,
4
)
if
len
(
parts
)
!=
5
:
raise
ValueError
(
"Not enough fields in "
+
`line`
)
function
,
type
,
arg
,
refcount
,
comment
=
parts
...
...
Doc/tools/rewrite.py
Dosyayı görüntüle @
071972e4
...
...
@@ -3,7 +3,6 @@
Usage: rewrite.py boilerplate.tex [VAR=value] ... <template >output
"""
import
string
import
sys
import
time
...
...
@@ -12,9 +11,9 @@ def get_info(fp):
s
=
fp
.
read
()
d
=
{}
start
=
s
tring
.
find
(
s
,
r"\date{"
)
start
=
s
.
find
(
r"\date{"
)
if
start
>=
0
:
end
=
s
tring
.
find
(
s
,
"}"
,
start
)
end
=
s
.
find
(
"}"
,
start
)
date
=
s
[
start
+
6
:
end
]
if
date
==
r"\today"
:
date
=
time
.
strftime
(
"
%
B
%
d,
%
Y"
,
time
.
localtime
(
time
.
time
()))
...
...
@@ -28,14 +27,14 @@ def main():
# yes, we actully need to load the replacement values
d
=
get_info
(
open
(
sys
.
argv
[
1
]))
for
arg
in
sys
.
argv
[
2
:]:
name
,
value
=
string
.
split
(
arg
,
"="
,
1
)
name
,
value
=
arg
.
split
(
"="
,
1
)
d
[
name
]
=
value
start
=
0
while
1
:
start
=
s
tring
.
find
(
s
,
"@"
,
start
)
start
=
s
.
find
(
"@"
,
start
)
if
start
<
0
:
break
end
=
s
tring
.
find
(
s
,
"@"
,
start
+
1
)
end
=
s
.
find
(
"@"
,
start
+
1
)
name
=
s
[
start
+
1
:
end
]
if
name
:
value
=
d
.
get
(
name
)
...
...
Doc/tools/support.py
Dosyayı görüntüle @
071972e4
...
...
@@ -8,7 +8,6 @@ __version__ = '$Revision$'
import
getopt
import
string
import
sys
...
...
@@ -71,7 +70,7 @@ class Options:
self
.
args
=
self
.
args
+
args
for
opt
,
val
in
opts
:
if
opt
in
(
"-a"
,
"--address"
):
val
=
string
.
strip
(
val
)
val
=
val
.
strip
(
)
if
val
:
val
=
"<address>
\n
%
s
\n
</address>
\n
"
%
val
self
.
variables
[
"address"
]
=
val
...
...
Doc/tools/toc2bkm.py
Dosyayı görüntüle @
071972e4
...
...
@@ -58,7 +58,7 @@ def parse_toc(fp, bigpart=None):
if
m
:
stype
,
snum
,
title
,
pageno
=
m
.
group
(
1
,
2
,
3
,
4
)
title
=
clean_title
(
title
)
entry
=
(
stype
,
snum
,
title
,
string
.
atoi
(
pageno
),
[])
entry
=
(
stype
,
snum
,
title
,
int
(
pageno
),
[])
if
stype
==
level
:
toc
.
append
(
entry
)
else
:
...
...
@@ -99,7 +99,7 @@ def clean_title(title):
pos
=
start
+
1
else
:
break
title
=
string
.
translate
(
title
,
title_trans
,
"{}"
)
title
=
title
.
translate
(
title_trans
,
"{}"
)
return
title
...
...
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