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
00f9fea2
Kaydet (Commit)
00f9fea2
authored
Ara 24, 1997
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use string.replace instead of regsub.[g]sub.
üst
b9b50eb7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
17 deletions
+13
-17
CGIHTTPServer.py
Lib/CGIHTTPServer.py
+1
-2
binhex.py
Lib/binhex.py
+1
-2
cgi.py
Lib/cgi.py
+6
-7
mhlib.py
Lib/mhlib.py
+4
-4
telnetlib.py
Lib/telnetlib.py
+1
-2
No files found.
Lib/CGIHTTPServer.py
Dosyayı görüntüle @
00f9fea2
...
@@ -148,8 +148,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
...
@@ -148,8 +148,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
if
ua
:
if
ua
:
env
[
'HTTP_USER_AGENT'
]
=
ua
env
[
'HTTP_USER_AGENT'
]
=
ua
# XXX Other HTTP_* headers
# XXX Other HTTP_* headers
import
regsub
decoded_query
=
string
.
replace
(
query
,
'+'
,
' '
)
decoded_query
=
regsub
.
gsub
(
'+'
,
' '
,
query
)
try
:
try
:
os
.
setuid
(
nobody
)
os
.
setuid
(
nobody
)
except
os
.
error
:
except
os
.
error
:
...
...
Lib/binhex.py
Dosyayı görüntüle @
00f9fea2
...
@@ -76,7 +76,6 @@ else:
...
@@ -76,7 +76,6 @@ else:
#
#
# Glue code for non-macintosh useage
# Glue code for non-macintosh useage
#
#
import
regsub
class
FInfo
:
class
FInfo
:
def
__init__
(
self
):
def
__init__
(
self
):
...
@@ -99,7 +98,7 @@ else:
...
@@ -99,7 +98,7 @@ else:
dsize
=
fp
.
tell
()
dsize
=
fp
.
tell
()
fp
.
close
()
fp
.
close
()
dir
,
file
=
os
.
path
.
split
(
name
)
dir
,
file
=
os
.
path
.
split
(
name
)
file
=
regsub
.
sub
(
':'
,
'-'
,
file
)
file
=
string
.
replace
(
file
,
':'
,
'-'
,
1
)
return
file
,
finfo
,
dsize
,
0
return
file
,
finfo
,
dsize
,
0
class
openrsrc
:
class
openrsrc
:
...
...
Lib/cgi.py
Dosyayı görüntüle @
00f9fea2
...
@@ -420,7 +420,6 @@ import string
...
@@ -420,7 +420,6 @@ import string
import
sys
import
sys
import
os
import
os
import
urllib
import
urllib
import
regsub
import
mimetools
import
mimetools
import
rfc822
import
rfc822
from
StringIO
import
StringIO
from
StringIO
import
StringIO
...
@@ -564,8 +563,8 @@ def parse_qs(qs, keep_blank_values=0, strict_parsing=0):
...
@@ -564,8 +563,8 @@ def parse_qs(qs, keep_blank_values=0, strict_parsing=0):
if
strict_parsing
:
if
strict_parsing
:
raise
ValueError
,
"bad query field:
%
s"
%
`name_value`
raise
ValueError
,
"bad query field:
%
s"
%
`name_value`
continue
continue
name
=
urllib
.
unquote
(
regsub
.
gsub
(
'+'
,
' '
,
nv
[
0
]
))
name
=
urllib
.
unquote
(
string
.
replace
(
nv
[
0
],
'+'
,
' '
))
value
=
urllib
.
unquote
(
regsub
.
gsub
(
'+'
,
' '
,
nv
[
1
]
))
value
=
urllib
.
unquote
(
string
.
replace
(
nv
[
1
],
'+'
,
' '
))
if
len
(
value
)
or
keep_blank_values
:
if
len
(
value
)
or
keep_blank_values
:
if
dict
.
has_key
(
name
):
if
dict
.
has_key
(
name
):
dict
[
name
]
.
append
(
value
)
dict
[
name
]
.
append
(
value
)
...
@@ -1317,11 +1316,11 @@ environment as well. Here are some common variable names:
...
@@ -1317,11 +1316,11 @@ environment as well. Here are some common variable names:
def
escape
(
s
,
quote
=
None
):
def
escape
(
s
,
quote
=
None
):
"""Replace special characters '&', '<' and '>' by SGML entities."""
"""Replace special characters '&', '<' and '>' by SGML entities."""
s
=
regsub
.
gsub
(
"&"
,
"&"
,
s
)
# Must be done first!
s
=
string
.
replace
(
s
,
"&"
,
"&"
)
# Must be done first!
s
=
regsub
.
gsub
(
"<"
,
"<"
,
s
)
s
=
string
.
replace
(
s
,
"<"
,
"<"
)
s
=
regsub
.
gsub
(
">"
,
">"
,
s
)
s
=
string
.
replace
(
s
,
">"
,
">"
,
)
if
quote
:
if
quote
:
s
=
regsub
.
gsub
(
'"'
,
"""
,
s
)
s
=
string
.
replace
(
s
,
'"'
,
"""
)
return
s
return
s
...
...
Lib/mhlib.py
Dosyayı görüntüle @
00f9fea2
...
@@ -773,7 +773,7 @@ class SubMessage(Message):
...
@@ -773,7 +773,7 @@ class SubMessage(Message):
# - the string used to initialize the set (default ''),
# - the string used to initialize the set (default ''),
# - the separator between ranges (default ',')
# - the separator between ranges (default ',')
# - the separator between begin and end of a range (default '-')
# - the separator between begin and end of a range (default '-')
# The separators m
ay be regular expressions
and should be different.
# The separators m
ust be strings (not regexprs)
and should be different.
#
#
# The tostring() function yields a string that can be passed to another
# The tostring() function yields a string that can be passed to another
# IntSet constructor; __repr__() is a valid IntSet constructor itself.
# IntSet constructor; __repr__() is a valid IntSet constructor itself.
...
@@ -882,11 +882,11 @@ class IntSet:
...
@@ -882,11 +882,11 @@ class IntSet:
self
.
normalize
()
self
.
normalize
()
def
fromstring
(
self
,
data
):
def
fromstring
(
self
,
data
):
import
string
,
regsub
import
string
new
=
[]
new
=
[]
for
part
in
regsub
.
split
(
data
,
self
.
sep
):
for
part
in
string
.
splitfields
(
data
,
self
.
sep
):
list
=
[]
list
=
[]
for
subp
in
regsub
.
split
(
part
,
self
.
rng
):
for
subp
in
string
.
splitfields
(
part
,
self
.
rng
):
s
=
string
.
strip
(
subp
)
s
=
string
.
strip
(
subp
)
list
.
append
(
string
.
atoi
(
s
))
list
.
append
(
string
.
atoi
(
s
))
if
len
(
list
)
==
1
:
if
len
(
list
)
==
1
:
...
...
Lib/telnetlib.py
Dosyayı görüntüle @
00f9fea2
...
@@ -38,7 +38,6 @@ To do:
...
@@ -38,7 +38,6 @@ To do:
import
socket
import
socket
import
select
import
select
import
string
import
string
import
regsub
# Tunable parameters
# Tunable parameters
DEBUGLEVEL
=
0
DEBUGLEVEL
=
0
...
@@ -185,7 +184,7 @@ class Telnet:
...
@@ -185,7 +184,7 @@ class Telnet:
"""
"""
if
IAC
in
buffer
:
if
IAC
in
buffer
:
buffer
=
regsub
.
gsub
(
IAC
,
IAC
+
IAC
,
buffer
)
buffer
=
string
.
replace
(
buffer
,
IAC
,
IAC
+
IAC
)
self
.
sock
.
send
(
buffer
)
self
.
sock
.
send
(
buffer
)
def
read_until
(
self
,
match
,
timeout
=
None
):
def
read_until
(
self
,
match
,
timeout
=
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