Basic minidom changes to support the new higher-performance builder, as
described: http://mail.python.org/pipermail/xml-sig/2002-February/007217.html
Use True/False where appropriate.
isSupported(): Implemented from DOM Level 2.
Support a variety of things from the DOM Level 3 draft, integrate with
the xml.dom.xmlbuilder module for the new Document and
DOMImplementation methods.
Support the NODE_CLONED callback for the UserDataHandler set using
setUserData().
Add Entity and Notation nodes to minidom.
Add __getitem__() to ReadOnlySequentialNamedNodeMap to match NamedNodeMap.
TupleType was used without being defined; rename to _TupleType and define.
Add magic so that instances of the NamedNodeMap (and its read-only cousin)
take a bit less memory in the new-style world of Python 2.2/2.3. Now, the
assignments to __slots__ actually work. ;-)
Add support for the Text.wholeText attribute.
Document.createCDATASection(): Do not pass unsupported arg to CDATASection
constructor.
Implemented Text.replaceWholeText().
Updated minidom interfaces to work better with current 4Suite XPath and Xslt.
* Added childNodes to class Attr
* Added localName and prefix to all Nodes
* Added specified on class Attr
* Changed DOMImplementation.createDocument to all creating a document with no document element and
a
Null doctype
* Changed CharacterData__setattr__ to keep nodeValue and data in synch
* fixed typo of ownerDoc in createDocumentFragment
* Changed Comment to inherit from CharacterData
* Allowed mutation of name on PIs
* Added importNode and rewrote cloneNode so both use same code base
* Changed EmptyNodeList to be a list not a tuple
Use a table-driven DOMImplementation.hasFeature().
Shorten lines longer than 80 characters.
Rename CloneNode to _clone_node (better naming consistency within the
module).
When defining localName as a property, the defproperty() call is
needed for each class that defined _get_localName(), otherwise only
the first version is used for Python 2.2 and newer.
Node.insertBefore(): When the reference node is not found, raise the
exception defined by the DOM specification.
Attr._set_value(): Added setter that does the right thing.
Childless.removeChild(): Raise the exception defined by the
specification, even though it seem less than intuitive.
_clone_node(): Access nodeType constants so we actually find them.
Add support for document fragments.
Node.removeChild(), .replaceChild():
Fix exception raised when a reference node is not found.
CharacterData._set_data(): Update the nodeValue attribute as well as
the data attribute.
Entity.attributes, .childNodes: Added these attributes.
Document.removeChild(): Raise the right exception when the node being
removed is not a child of this node.
Element.removeAttributeNode(): Raise the right exception when the
node isn't present on this element. Don't unlink the node unless
it is present.
Added support for the following methods and accessors:
Node._get_childNodes(), Attr._get_specified(), Attr._set_prefix(),
NamedNodeMap.has_key(), .getNamedItem(), .getNamedItemNS(),
.removeNamedItem(), .removeNamedItemNS(),
ProcessingInstruction._get_data(), ._get_target(), ._set_data(),
._set_target(), CharacterData.__len__(),
Document.getElementById().
Add many more of the _get_*() accessors.
Convert internal helpers to use a more consistent naming convention.
Remove unused definition of _nssplit(); there can be only one!
Move the Identified mixin up so it can be used by one more class.
Remove comment about NamedNodeMap.__getitem__(); the API won't be
changing now! Way too late for that.
Preliminary support for getElementById() for DOMs built with
xml.dom.expatbuilder.
Not necessarily very efficient, but it works, and is still fast for Document
instances that do not have the ID information.
DOMImplementation.createDocument(): Don't forget to add the
DocumentType node to the tree. This appearantly was lost in the
previous release.
DocumentType.writexml(): New function.
Implement the final determination on the behaviors of importNode() and
cloneNode() with regard to Document and DocumentType nodes.
When cloning and importing, call the UserDataHandler with the right
operation, not just blindly use NODE_CLONED.
parse(), parseString(): When called with parser=None, use
xml.dom.expatbuilder instead of xml.dom.pulldom, to get a performance
boost (the main point of expatbuilder).
Fix for calling parse / parseString with a given parser instance;
the else-paths were ignored when refactoring the function signatures;
pychecker found that error instantly, BTW (hint, hint)
Added pickle support for NamedNodeMap, ReadOnlySequentialNamedNodeMap,
and ElementInfo. Closes SF bug #609641.
In _clone_node for elements, fixed arguments for getAttributeNodeNS
At least make sure the DOM API won't allow you to modify the child
node list of an entity node (since entity ndoes are supposed to be
readonly).
Add support for the DOM Level 3 (draft) DOMImplementationSource interface
to the xml.dom and xml.dom.minidom modules. Note API issue: the draft spec
says to return null when there is no suitable implementation, while the
Python getDOMImplementation() function raises ImportError (minor).
Implement the DOM Level 3 Attr.isId property.
Refactor the lookup of the ElementInfo objects.
Implement the schemaType attribute for Element and Attr nodes.
Defined by the (draft) DOM Level 3 specification.
getElementById(): Support caching of IDs found. This implementation is
sufficient for DOM Level 2 compliance, but additional changes will be
needed to support the setIdAttribute() and setIdAttributeNS() methods
in DOM Level 3.
Add support for Text.isWhitespaceInElementContent (draft Level 3).
NamedNodeMap.removeNamedItem(), .removeNamedItemNS():
Pass the new tests: Return the removed node, or raise NotFoundErr
if there was no matching node.
When changing attributes via a NamedNodeMap, update the ID-cache
appropriately.
Added support for the DOM Level 3 (draft) Element.setIdAttribute*() methods.
setAttributeNode(): Be more careful about not calling
removeAttributeNode() twice for a single node.
Do more to avoid creating new Attr nodes, so that attributes do not lose
their ID-ness when set using setIdAttribute*().
Work harder to avoid calls to Attr.__setattr__() and
CharacterData.__setattr__().
Attr.unlink():
Implement everything directly instead of calling to the base
class, which does several things that aren't needed for Attr
nodes.
Change some remaining assignments that caused __setattr__() to be
called when it can be avoided. expatbuilder can now perform DOM
construction without __setattr__() interferance in common cases.
Remove unused _make_parent_nodes logic.
compare against "the other" argument, we raise TypeError,
in order to prevent comparison from falling back to the
default (and worse than useless, in this case) comparison
by object address.
That's fine so far as it goes, but leaves no way for
another date/datetime object to make itself comparable
to our objects. For example, it leaves Marc-Andre no way
to teach mxDateTime dates how to compare against Python
dates.
Discussion on Python-Dev raised a number of impractical
ideas, and the simple one implemented here: when we don't
know how to compare against "the other" argument, we raise
TypeError *unless* the other object has a timetuple attr.
In that case, we return NotImplemented instead, and Python
will give the other object a shot at handling the
comparison then.
Note that comparisons of time and timedelta objects still
suffer the original problem, though.
add memoize() helper function to update the memo.
The first element of the tuple returned by __reduce__() must be a
callable. If it isn't the Unpickler will raise an error. Catch this
error in the pickler and raise the error there.
The memoize() helper also has a comment explaining how the memo
works. So methods can't use memoize() because the write funny codes.
This gives much the same treatment to datetime.fromtimestamp(stamp, tz) as
the last batch of checkins gave to datetime.now(tz): do "the obvious"
thing with the tz argument instead of a senseless thing.
checked in two days agao:
Refactoring of, and new rules for, dt.astimezone(tz).
dt must be aware now, and tz.utcoffset() and tz.dst() must not return None.
The old dt.astimezone(None) no longer works to change an aware datetime
into a naive datetime; use dt.replace(tzinfo=None) instead.
The tzinfo base class now supplies a new fromutc(self, dt) method, and
datetime.astimezone(tz) invokes tz.fromutc(). The default implementation
of fromutc() reproduces the same results as the old astimezone()
implementation, but tzinfo subclasses can override fromutc() if the
default implementation isn't strong enough to get the correct results
in all cases (for example, this may be necessary if a tzinfo subclass
models a time zone whose "standard offset" (wrt UTC) changed in some
year(s), or in some variations of double-daylight time -- the creativity
of time zone politics can't be captured in a single default implementation).
tzinfo.fromutc() method. The C code doesn't implement any of this
yet (well, not the C code on the machine I'm using now), nor does
the test suite reflect it. The Python datetime.py implementation and
test suite in the sandbox do match these doc changes. The C
implementation probably won't catch up before Thursday (Wednesday is
a scheduled "black hole" day this week <0.4 wink>).
Sebastien Keim pointed out that iterkeys and __contains__ require
their own definitions so their behavior will update when the
underlying method is subclassed.
M PyShell.py
M config-keys.def
M configHandler.py
1. Clear any un-entered characters from input line before printing the
restart boundary.
2. Restore the Debug menu: There are now both Shell and Debug menus.
3. Add Control-F6 keybinding to Restart Shell.
4. Clarify PyShell.cancel_check() comment.
5. Update doc string for Bindings.py and re-format the file slightly.