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
ab199622
Kaydet (Commit)
ab199622
authored
May 31, 2002
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use more string methods, remove import string
üst
3f8dae73
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
18 deletions
+12
-18
minidom.py
Lib/xml/dom/minidom.py
+6
-11
__init__.py
Lib/xml/sax/__init__.py
+3
-3
expatreader.py
Lib/xml/sax/expatreader.py
+3
-4
No files found.
Lib/xml/dom/minidom.py
Dosyayı görüntüle @
ab199622
...
...
@@ -14,10 +14,6 @@ Todo:
* SAX 2 namespaces
"""
import
string
_string
=
string
del
string
from
xml.dom
import
HierarchyRequestErr
,
EMPTY_NAMESPACE
# localize the types, and allow support for Unicode values if available:
...
...
@@ -284,11 +280,10 @@ class Node(xml.dom.Node):
def
_write_data
(
writer
,
data
):
"Writes datachars to writer."
replace
=
_string
.
replace
data
=
replace
(
data
,
"&"
,
"&"
)
data
=
replace
(
data
,
"<"
,
"<"
)
data
=
replace
(
data
,
"
\"
"
,
"""
)
data
=
replace
(
data
,
">"
,
">"
)
data
=
data
.
replace
(
"&"
,
"&"
)
data
=
data
.
replace
(
"<"
,
"<"
)
data
=
data
.
replace
(
"
\"
"
,
"""
)
data
=
data
.
replace
(
">"
,
">"
)
writer
.
write
(
data
)
def
_getElementsByTagNameHelper
(
parent
,
name
,
rc
):
...
...
@@ -758,7 +753,7 @@ class CDATASection(Text):
def
_nssplit
(
qualifiedName
):
fields
=
_string
.
split
(
qualifiedName
,
':'
,
1
)
fields
=
qualifiedName
.
split
(
':'
,
1
)
if
len
(
fields
)
==
2
:
return
fields
elif
len
(
fields
)
==
1
:
...
...
@@ -787,7 +782,7 @@ class DOMImplementation:
def
hasFeature
(
self
,
feature
,
version
):
if
version
not
in
(
"1.0"
,
"2.0"
):
return
0
feature
=
_string
.
lower
(
feature
)
feature
=
feature
.
lower
(
)
return
feature
==
"core"
def
createDocument
(
self
,
namespaceURI
,
qualifiedName
,
doctype
):
...
...
Lib/xml/sax/__init__.py
Dosyayı görüntüle @
ab199622
...
...
@@ -58,14 +58,14 @@ _false = 0
if
_false
:
import
xml.sax.expatreader
import
os
,
s
tring
,
s
ys
import
os
,
sys
if
os
.
environ
.
has_key
(
"PY_SAX_PARSER"
):
default_parser_list
=
string
.
split
(
os
.
environ
[
"PY_SAX_PARSER"
],
","
)
default_parser_list
=
os
.
environ
[
"PY_SAX_PARSER"
]
.
split
(
","
)
del
os
_key
=
"python.xml.sax.parser"
if
sys
.
platform
[:
4
]
==
"java"
and
sys
.
registry
.
containsKey
(
_key
):
default_parser_list
=
s
tring
.
split
(
sys
.
registry
.
getProperty
(
_key
),
","
)
default_parser_list
=
s
ys
.
registry
.
getProperty
(
_key
)
.
split
(
","
)
def
make_parser
(
parser_list
=
[]):
...
...
Lib/xml/sax/expatreader.py
Dosyayı görüntüle @
ab199622
...
...
@@ -25,7 +25,6 @@ from xml.sax import xmlreader, saxutils, handler
AttributesImpl
=
xmlreader
.
AttributesImpl
AttributesNSImpl
=
xmlreader
.
AttributesNSImpl
import
string
import
weakref
# --- ExpatLocator
...
...
@@ -220,7 +219,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator):
self
.
_cont_handler
.
endElement
(
name
)
def
start_element_ns
(
self
,
name
,
attrs
):
pair
=
string
.
split
(
name
)
pair
=
name
.
split
(
)
if
len
(
pair
)
==
1
:
pair
=
(
None
,
name
)
else
:
...
...
@@ -228,7 +227,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator):
newattrs
=
{}
for
(
aname
,
value
)
in
attrs
.
items
():
apair
=
string
.
split
(
aname
)
apair
=
aname
.
split
(
)
if
len
(
apair
)
==
1
:
apair
=
(
None
,
aname
)
else
:
...
...
@@ -240,7 +239,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator):
AttributesNSImpl
(
newattrs
,
{}))
def
end_element_ns
(
self
,
name
):
pair
=
string
.
split
(
name
)
pair
=
name
.
split
(
)
if
len
(
pair
)
==
1
:
pair
=
(
None
,
name
)
else
:
...
...
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