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
6247fdbf
Kaydet (Commit)
6247fdbf
authored
Nis 27, 2007
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix print syntax so this runs using 3.0.
üst
4a76da79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
reindent.py
Tools/scripts/reindent.py
+9
-9
No files found.
Tools/scripts/reindent.py
Dosyayı görüntüle @
6247fdbf
...
...
@@ -45,8 +45,8 @@ dryrun = 0
def
usage
(
msg
=
None
):
if
msg
is
not
None
:
print
>>
sys
.
stderr
,
msg
print
>>
sys
.
stderr
,
__doc__
print
(
msg
,
file
=
sys
.
stderr
)
print
(
__doc__
,
file
=
sys
.
stderr
)
def
errprint
(
*
args
):
sep
=
""
...
...
@@ -85,7 +85,7 @@ def main():
def
check
(
file
):
if
os
.
path
.
isdir
(
file
)
and
not
os
.
path
.
islink
(
file
):
if
verbose
:
print
"listing directory"
,
file
print
(
"listing directory"
,
file
)
names
=
os
.
listdir
(
file
)
for
name
in
names
:
fullname
=
os
.
path
.
join
(
file
,
name
)
...
...
@@ -96,7 +96,7 @@ def check(file):
return
if
verbose
:
print
"checking"
,
file
,
"..."
,
print
(
"checking"
,
file
,
"..."
,
end
=
' '
)
try
:
f
=
open
(
file
)
except
IOError
as
msg
:
...
...
@@ -107,24 +107,24 @@ def check(file):
f
.
close
()
if
r
.
run
():
if
verbose
:
print
"changed."
print
(
"changed."
)
if
dryrun
:
print
"But this is a dry run, so leaving it alone."
print
(
"But this is a dry run, so leaving it alone."
)
if
not
dryrun
:
bak
=
file
+
".bak"
if
os
.
path
.
exists
(
bak
):
os
.
remove
(
bak
)
os
.
rename
(
file
,
bak
)
if
verbose
:
print
"renamed"
,
file
,
"to"
,
bak
print
(
"renamed"
,
file
,
"to"
,
bak
)
f
=
open
(
file
,
"w"
)
r
.
write
(
f
)
f
.
close
()
if
verbose
:
print
"wrote new"
,
file
print
(
"wrote new"
,
file
)
else
:
if
verbose
:
print
"unchanged."
print
(
"unchanged."
)
def
_rstrip
(
line
,
JUNK
=
'
\n
\t
'
):
"""Return line stripped of trailing spaces, tabs, newlines.
...
...
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