Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
A
astor
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
astor
Commits
f1d80cce
Kaydet (Commit)
f1d80cce
authored
Nis 26, 2017
tarafından
Patrick Maupin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add options for profiling and testing other tools.
üst
a957d588
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
rtrip.py
astor/rtrip.py
+25
-4
No files found.
astor/rtrip.py
Dosyayı görüntüle @
f1d80cce
...
...
@@ -244,12 +244,22 @@ def usage(msg):
if
__name__
==
'__main__'
:
import
textwrap
import
time
def
go
():
convert
(
fname
,
readonly
=
readonly
or
dumpall
,
dumpall
=
dumpall
,
ignore_exceptions
=
ignoreexc
,
fullcomp
=
fullcomp
and
not
dumpall
)
args
=
sys
.
argv
[
1
:]
readonly
=
'readonly'
in
args
if
readonly
:
args
.
remove
(
'readonly'
)
flags
=
[]
for
special
in
'readonly astunparse ignoreexc cprofile fullcomp'
.
split
():
x
=
special
in
args
if
x
:
args
.
remove
(
special
)
flags
.
append
(
special
)
globals
()[
special
]
=
x
if
not
args
:
args
=
[
os
.
path
.
dirname
(
textwrap
.
__file__
)]
...
...
@@ -257,10 +267,21 @@ if __name__ == '__main__':
if
len
(
args
)
>
1
:
usage
(
"Too many arguments"
)
if
astunparse
:
from
astunparse
import
unparse
as
to_source
if
cprofile
:
import
cProfile
cprofile
=
cProfile
.
run
fname
,
=
args
dumpall
=
False
if
not
os
.
path
.
exists
(
fname
):
dumpall
=
fname
==
'stdin'
or
usage
(
"Cannot find directory
%
s"
%
fname
)
logging
.
basicConfig
(
format
=
'
%(msg)
s'
,
level
=
logging
.
INFO
)
convert
(
fname
,
readonly
=
readonly
or
dumpall
,
dumpall
=
dumpall
)
start
=
time
.
time
()
cprofile
(
"go()"
)
if
cprofile
else
go
()
print
(
'Finished in
%0.2
f seconds'
%
(
time
.
time
()
-
start
))
print
(
"Used flags
%
s"
%
(
', '
.
join
(
flags
)
or
None
))
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