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
373c55e5
Kaydet (Commit)
373c55e5
authored
Şub 09, 2001
tarafından
Eric S. Raymond
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
String method conversion.
üst
9b93c5f2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
20 deletions
+17
-20
dis.py
Lib/dis.py
+3
-4
htmllib.py
Lib/htmllib.py
+5
-6
pstats.py
Lib/pstats.py
+9
-10
No files found.
Lib/dis.py
Dosyayı görüntüle @
373c55e5
"""Disassembler of Python byte code into mnemonics."""
import
sys
import
string
import
types
__all__
=
[
"dis"
,
"disassemble"
,
"distb"
,
"disco"
,
"opname"
,
"cmp_op"
,
...
...
@@ -69,8 +68,8 @@ def disassemble(co, lasti=-1):
else
:
print
' '
,
if
i
in
labels
:
print
'>>'
,
else
:
print
' '
,
print
string
.
rjust
(
`i`
,
4
),
print
string
.
ljust
(
opname
[
op
],
20
),
print
`i`
.
rjust
(
4
),
print
opname
[
op
]
.
ljust
(
20
),
i
=
i
+
1
if
op
>=
HAVE_ARGUMENT
:
oparg
=
ord
(
code
[
i
])
+
ord
(
code
[
i
+
1
])
*
256
+
extended_arg
...
...
@@ -78,7 +77,7 @@ def disassemble(co, lasti=-1):
i
=
i
+
2
if
op
==
EXTENDED_ARG
:
extended_arg
=
oparg
*
65536L
print
string
.
rjust
(
`oparg`
,
5
),
print
`oparg`
.
rjust
(
5
),
if
op
in
hasconst
:
print
'('
+
`co.co_consts[oparg]`
+
')'
,
elif
op
in
hasname
:
...
...
Lib/htmllib.py
Dosyayı görüntüle @
373c55e5
...
...
@@ -5,7 +5,6 @@ http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html
"""
import
string
from
sgmllib
import
SGMLParser
from
formatter
import
AS_IS
...
...
@@ -50,7 +49,7 @@ class HTMLParser(SGMLParser):
data
=
self
.
savedata
self
.
savedata
=
None
if
not
self
.
nofill
:
data
=
string
.
join
(
string
.
split
(
data
))
data
=
' '
.
join
(
data
.
split
(
))
return
data
# --- Hooks for anchors; should probably be overridden
...
...
@@ -321,13 +320,13 @@ class HTMLParser(SGMLParser):
name
=
''
type
=
''
for
attrname
,
value
in
attrs
:
value
=
string
.
strip
(
value
)
value
=
value
.
strip
(
)
if
attrname
==
'href'
:
href
=
value
if
attrname
==
'name'
:
name
=
value
if
attrname
==
'type'
:
type
=
string
.
lower
(
value
)
type
=
value
.
lower
(
)
self
.
anchor_bgn
(
href
,
name
,
type
)
def
end_a
(
self
):
...
...
@@ -362,10 +361,10 @@ class HTMLParser(SGMLParser):
if
attrname
==
'src'
:
src
=
value
if
attrname
==
'width'
:
try
:
width
=
string
.
atoi
(
value
)
try
:
width
=
int
(
value
)
except
:
pass
if
attrname
==
'height'
:
try
:
height
=
string
.
atoi
(
value
)
try
:
height
=
int
(
value
)
except
:
pass
self
.
handle_image
(
src
,
alt
,
ismap
,
align
,
width
,
height
)
...
...
Lib/pstats.py
Dosyayı görüntüle @
373c55e5
...
...
@@ -34,7 +34,6 @@
import
os
import
time
import
string
import
marshal
import
re
...
...
@@ -392,11 +391,11 @@ class Stats:
return
self
def
print_call_heading
(
self
,
name_size
,
column_title
):
print
string
.
ljust
(
"Function "
,
name_size
)
+
column_title
print
"Function "
.
ljust
(
name_size
)
+
column_title
def
print_call_line
(
self
,
name_size
,
source
,
call_dict
):
print
string
.
ljust
(
func_std_string
(
source
),
name_size
),
print
func_std_string
(
source
)
.
ljust
(
name_size
),
if
not
call_dict
:
print
"--"
return
...
...
@@ -414,11 +413,11 @@ class Stats:
def
print_title
(
self
):
print
string
.
rjust
(
'ncalls'
,
9
),
print
string
.
rjust
(
'tottime'
,
8
),
print
string
.
rjust
(
'percall'
,
8
),
print
string
.
rjust
(
'cumtime'
,
8
),
print
string
.
rjust
(
'percall'
,
8
),
print
'ncalls'
.
rjust
(
9
),
print
'tottime'
.
rjust
(
8
),
print
'percall'
.
rjust
(
8
),
print
'cumtime'
.
rjust
(
8
),
print
'percall'
.
rjust
(
8
),
print
'filename:lineno(function)'
...
...
@@ -427,7 +426,7 @@ class Stats:
c
=
`nc`
if
nc
!=
cc
:
c
=
c
+
'/'
+
`cc`
print
string
.
rjust
(
c
,
9
),
print
c
.
rjust
(
9
),
print
f8
(
tt
),
if
nc
==
0
:
print
' '
*
8
,
...
...
@@ -522,4 +521,4 @@ def count_calls(callers):
#**************************************************************************
def
f8
(
x
):
return
string
.
rjust
(
fpformat
.
fix
(
x
,
3
),
8
)
return
fpformat
.
fix
(
x
,
3
)
.
rjust
(
8
)
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