[Zope3-checkins] CVS: Zope3/src/zope/xmlpickle -
__init__.py:1.3.28.1 xmlpickle.py:1.3.36.1
Fred L. Drake, Jr.
fred at zope.com
Fri Sep 12 12:00:45 EDT 2003
Update of /cvs-repository/Zope3/src/zope/xmlpickle
In directory cvs.zope.org:/tmp/cvs-serv22534/xmlpickle
Modified Files:
Tag: parentgeddon-branch
__init__.py xmlpickle.py
Log Message:
add the functions fromxml(), toxml() to the zope.xmlpickle API
=== Zope3/src/zope/xmlpickle/__init__.py 1.3 => 1.3.28.1 ===
--- Zope3/src/zope/xmlpickle/__init__.py:1.3 Tue May 6 15:58:44 2003
+++ Zope3/src/zope/xmlpickle/__init__.py Fri Sep 12 12:00:45 2003
@@ -21,3 +21,4 @@
"""
from xmlpickle import dumps, loads
+from xmlpickle import fromxml, toxml
=== Zope3/src/zope/xmlpickle/xmlpickle.py 1.3 => 1.3.36.1 ===
--- Zope3/src/zope/xmlpickle/xmlpickle.py:1.3 Thu May 1 07:00:05 2003
+++ Zope3/src/zope/xmlpickle/xmlpickle.py Fri Sep 12 12:00:45 2003
@@ -73,7 +73,7 @@
_PicklerThatSortsDictItems(file, bin).dump(object)
return file.getvalue()
-def p2xml(p):
+def toxml(p):
"""Convert a standard Python pickle to xml
"""
u = ppml.ToXMLUnpickler(StringIO(p))
@@ -86,9 +86,9 @@
"""Serialize an object to XML
"""
p = _dumpsUsing_PicklerThatSortsDictItems(ob, 1)
- return p2xml(p)
+ return toxml(p)
-def xml2p(xml):
+def fromxml(xml):
"""Convert xml to a standard Python pickle
"""
handler = ppml.xmlPickler()
@@ -104,6 +104,6 @@
def loads(xml):
"""Create an object from serialized XML
"""
- pickle = xml2p(xml)
+ pickle = fromxml(xml)
ob = _standard_pickle_loads(pickle)
return ob
More information about the Zope3-Checkins
mailing list