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
867754e3
Kaydet (Commit)
867754e3
authored
May 09, 2011
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge 11164
üst
8ffaa104
2f48d892
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
10 additions
and
105 deletions
+10
-105
introduction.rst
Doc/distutils/introduction.rst
+1
-1
modulefinder.rst
Doc/library/modulefinder.rst
+1
-2
xml.dom.minidom.rst
Doc/library/xml.dom.minidom.rst
+2
-6
xml.dom.rst
Doc/library/xml.dom.rst
+0
-7
modulefinder.py
Lib/modulefinder.py
+4
-3
test_minidom.py
Lib/test/test_minidom.py
+0
-20
test_sax.py
Lib/test/test_sax.py
+0
-45
__init__.py
Lib/xml/__init__.py
+0
-21
NEWS
Misc/NEWS
+2
-0
No files found.
Doc/distutils/introduction.rst
Dosyayı görüntüle @
867754e3
...
...
@@ -187,7 +187,7 @@ modules using the Distutils:
module distribution
a collection of Python modules distributed together as a single downloadable
resource and meant to be installed *en masse*. Examples of some well-known
module distributions are Num
eric Python, PyXML
, PIL (the Python Imaging
module distributions are Num
Py, SciPy
, PIL (the Python Imaging
Library), or mxBase. (This would be called a *package*, except that term is
already taken in the Python context: a single module distribution may contain
zero, one, or many Python packages.)
...
...
Doc/library/modulefinder.rst
Dosyayı görüntüle @
867754e3
...
...
@@ -25,8 +25,7 @@ report of the imported modules will be printed.
.. function:: ReplacePackage(oldname, newname)
Allows specifying that the module named *oldname* is in fact the package named
*
newname
*.
The
most
common
usage
would
be
to
handle
how
the
:
mod
:`
_xmlplus
`
package
replaces
the
:
mod
:`
xml
`
package
.
*newname*.
.. class:: ModuleFinder(path=None, debug=0, excludes=[], replace_paths=[])
...
...
Doc/library/xml.dom.minidom.rst
Dosyayı görüntüle @
867754e3
...
...
@@ -60,12 +60,8 @@ functions do not provide a parser implementation themselves.
You can also create a :class:`Document` by calling a method on a "DOM
Implementation" object. You can get this object either by calling the
:func:`getDOMImplementation` function in the :mod:`xml.dom` package or the
:mod:`xml.dom.minidom` module. Using the implementation from the
:mod:`xml.dom.minidom` module will always return a :class:`Document` instance
from the minidom implementation, while the version from :mod:`xml.dom` may
provide an alternate implementation (this is likely if you have the `PyXML
package <http://pyxml.sourceforge.net/>`_ installed). Once you have a
:class:`Document`, you can add child nodes to it to populate the DOM::
:mod:`xml.dom.minidom` module. Once you have a :class:`Document`, you
can add child nodes to it to populate the DOM::
from xml.dom.minidom import getDOMImplementation
...
...
Doc/library/xml.dom.rst
Dosyayı görüntüle @
867754e3
...
...
@@ -30,13 +30,6 @@ The Document Object Model is being defined by the W3C in stages, or "levels" in
their terminology. The Python mapping of the API is substantially based on the
DOM Level 2 recommendation.
.. XXX PyXML is dead...
.. The mapping of the Level 3 specification, currently
only available in draft form, is being developed by the `Python XML Special
Interest Group <http://www.python.org/sigs/xml-sig/>`_ as part of the `PyXML
package <http://pyxml.sourceforge.net/>`_. Refer to the documentation bundled
with that package for information on the current state of DOM Level 3 support.
.. What if your needs are somewhere between SAX and the DOM? Perhaps
you cannot afford to load the entire tree in memory but you find the
SAX model somewhat cumbersome and low-level. There is also a module
...
...
Lib/modulefinder.py
Dosyayı görüntüle @
867754e3
...
...
@@ -35,9 +35,10 @@ def AddPackagePath(packagename, path):
replacePackageMap
=
{}
# This ReplacePackage mechanism allows modulefinder to work around the
# way the _xmlplus package injects itself under the name "xml" into
# sys.modules at runtime by calling ReplacePackage("_xmlplus", "xml")
# This ReplacePackage mechanism allows modulefinder to work around
# situations in which a package injects itself under the name
# of another package into sys.modules at runtime by calling
# ReplacePackage("real_package_name", "faked_package_name")
# before running ModuleFinder.
def
ReplacePackage
(
oldname
,
newname
):
...
...
Lib/test/test_minidom.py
Dosyayı görüntüle @
867754e3
...
...
@@ -45,26 +45,6 @@ def create_doc_with_doctype():
return
doc
class
MinidomTest
(
unittest
.
TestCase
):
def
tearDown
(
self
):
try
:
Node
.
allnodes
except
AttributeError
:
# We don't actually have the minidom from the standard library,
# but are picking up the PyXML version from site-packages.
pass
else
:
self
.
confirm
(
len
(
Node
.
allnodes
)
==
0
,
"assertion: len(Node.allnodes) == 0"
)
if
len
(
Node
.
allnodes
):
print
(
"Garbage left over:"
)
if
verbose
:
print
(
list
(
Node
.
allnodes
.
items
())[
0
:
10
])
else
:
# Don't print specific nodes if repeatable results
# are needed
print
(
len
(
Node
.
allnodes
))
Node
.
allnodes
=
{}
def
confirm
(
self
,
test
,
testname
=
"Test"
):
self
.
assertTrue
(
test
,
testname
)
...
...
Lib/test/test_sax.py
Dosyayı görüntüle @
867754e3
...
...
@@ -794,51 +794,6 @@ class XmlReaderTest(XmlTestBase):
self
.
assertEqual
(
attrs
.
getQNameByName
((
ns_uri
,
"attr"
)),
"ns:attr"
)
# During the development of Python 2.5, an attempt to move the "xml"
# package implementation to a new package ("xmlcore") proved painful.
# The goal of this change was to allow applications to be able to
# obtain and rely on behavior in the standard library implementation
# of the XML support without needing to be concerned about the
# availability of the PyXML implementation.
#
# While the existing import hackery in Lib/xml/__init__.py can cause
# PyXML's _xmlpus package to supplant the "xml" package, that only
# works because either implementation uses the "xml" package name for
# imports.
#
# The move resulted in a number of problems related to the fact that
# the import machinery's "package context" is based on the name that's
# being imported rather than the __name__ of the actual package
# containment; it wasn't possible for the "xml" package to be replaced
# by a simple module that indirected imports to the "xmlcore" package.
#
# The following two tests exercised bugs that were introduced in that
# attempt. Keeping these tests around will help detect problems with
# other attempts to provide reliable access to the standard library's
# implementation of the XML support.
def
test_sf_1511497
(
self
):
# Bug report: http://www.python.org/sf/1511497
import
sys
old_modules
=
sys
.
modules
.
copy
()
for
modname
in
list
(
sys
.
modules
.
keys
()):
if
modname
.
startswith
(
"xml."
):
del
sys
.
modules
[
modname
]
try
:
import
xml.sax.expatreader
module
=
xml
.
sax
.
expatreader
self
.
assertEqual
(
module
.
__name__
,
"xml.sax.expatreader"
)
finally
:
sys
.
modules
.
update
(
old_modules
)
def
test_sf_1513611
(
self
):
# Bug report: http://www.python.org/sf/1513611
sio
=
StringIO
(
"invalid"
)
parser
=
make_parser
()
from
xml.sax
import
SAXParseException
self
.
assertRaises
(
SAXParseException
,
parser
.
parse
,
sio
)
def
test_main
():
run_unittest
(
MakeParserTest
,
SaxutilsTest
,
...
...
Lib/xml/__init__.py
Dosyayı görüntüle @
867754e3
...
...
@@ -18,24 +18,3 @@ etree -- The ElementTree XML library. This is a subset of the full
__all__
=
[
"dom"
,
"parsers"
,
"sax"
,
"etree"
]
_MINIMUM_XMLPLUS_VERSION
=
(
0
,
8
,
4
)
try
:
import
_xmlplus
except
ImportError
:
pass
else
:
try
:
v
=
_xmlplus
.
version_info
except
AttributeError
:
# _xmlplus is too old; ignore it
pass
else
:
if
v
>=
_MINIMUM_XMLPLUS_VERSION
:
import
sys
_xmlplus
.
__path__
.
extend
(
__path__
)
sys
.
modules
[
__name__
]
=
_xmlplus
else
:
del
v
Misc/NEWS
Dosyayı görüntüle @
867754e3
...
...
@@ -83,6 +83,8 @@ Core and Builtins
Library
-------
-
Issue
#
11164
:
Stop
trying
to
use
_xmlplus
in
the
xml
module
.
-
Issue
#
11927
:
SMTP_SSL
now
uses
port
465
by
default
as
documented
.
Patch
by
Kasun
Herath
.
...
...
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