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
ee5e61d3
Kaydet (Commit)
ee5e61d3
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
6b71e747
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
gzip.py
Lib/gzip.py
+5
-5
keyword.py
Lib/keyword.py
+3
-3
No files found.
Lib/gzip.py
Dosyayı görüntüle @
ee5e61d3
...
...
@@ -5,7 +5,7 @@ but random access is not allowed."""
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
import
str
ing
,
str
uct
,
sys
,
time
import
struct
,
sys
,
time
import
zlib
import
__builtin__
...
...
@@ -138,7 +138,7 @@ class GzipFile:
self
.
fileobj
.
write
(
self
.
compress
.
compress
(
data
)
)
def
writelines
(
self
,
lines
):
self
.
write
(
string
.
join
(
lines
))
self
.
write
(
" "
.
join
(
lines
))
def
read
(
self
,
size
=-
1
):
if
self
.
extrasize
<=
0
and
self
.
fileobj
is
None
:
...
...
@@ -281,10 +281,10 @@ class GzipFile:
readsize
=
min
(
100
,
size
)
# Read from the file in small chunks
while
1
:
if
size
==
0
:
return
string
.
join
(
bufs
,
''
)
# Return resulting line
return
""
.
join
(
bufs
)
# Return resulting line
c
=
self
.
read
(
readsize
)
i
=
string
.
find
(
c
,
'
\n
'
)
i
=
c
.
find
(
'
\n
'
)
if
size
is
not
None
:
# We set i=size to break out of the loop under two
# conditions: 1) there's no newline, and the chunk is
...
...
@@ -296,7 +296,7 @@ class GzipFile:
if
i
>=
0
or
c
==
''
:
bufs
.
append
(
c
[:
i
+
1
])
# Add portion of last chunk
self
.
_unread
(
c
[
i
+
1
:])
# Push back rest of chunk
return
string
.
join
(
bufs
,
''
)
# Return resulting line
return
''
.
join
(
bufs
)
# Return resulting line
# Append chunk to list, decrease 'size',
bufs
.
append
(
c
)
...
...
Lib/keyword.py
Dosyayı görüntüle @
ee5e61d3
...
...
@@ -52,7 +52,7 @@ for keyword in kwlist:
iskeyword
=
kwdict
.
has_key
def
main
():
import
sys
,
re
,
string
import
sys
,
re
args
=
sys
.
argv
[
1
:]
iptfile
=
args
and
args
[
0
]
or
"Python/graminit.c"
...
...
@@ -66,7 +66,7 @@ def main():
while
1
:
line
=
fp
.
readline
()
if
not
line
:
break
if
string
.
find
(
line
,
'{1, "'
)
>
-
1
:
if
line
.
find
(
'{1, "'
)
>
-
1
:
match
=
strprog
.
search
(
line
)
if
match
:
lines
.
append
(
" '"
+
match
.
group
(
1
)
+
"',
\n
"
)
...
...
@@ -89,7 +89,7 @@ def main():
# write the output file
fp
=
open
(
optfile
,
'w'
)
fp
.
write
(
string
.
join
(
format
,
''
))
fp
.
write
(
''
.
join
(
format
))
fp
.
close
()
if
__name__
==
"__main__"
:
...
...
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