Commit 5c375d8e authored by Chris McDonough's avatar Chris McDonough

Added long datatype handlers.

parent 17ea61a4
...@@ -530,6 +530,9 @@ class xmlUnpickler(NoBlanks, xyap): ...@@ -530,6 +530,9 @@ class xmlUnpickler(NoBlanks, xyap):
start_handlers={'pickle': start_pickle} start_handlers={'pickle': start_pickle}
end_handlers={ end_handlers={
'int': 'int':
lambda self,tag,data,atoi=string.atoi,name=name:
atoi(name(self, tag, data)),
'long':
lambda self,tag,data,atoi=string.atoi,name=name: lambda self,tag,data,atoi=string.atoi,name=name:
atoi(name(self, tag, data)), atoi(name(self, tag, data)),
'boolean': 'boolean':
...@@ -695,6 +698,7 @@ class xmlPickler(NoBlanks, xyap): ...@@ -695,6 +698,7 @@ class xmlPickler(NoBlanks, xyap):
'pickle': lambda self, tag, data: data[2]+'.', 'pickle': lambda self, tag, data: data[2]+'.',
'none': lambda self, tag, data: 'N', 'none': lambda self, tag, data: 'N',
'int': save_int, 'int': save_int,
'long': lambda self, tag, data: 'L'+data[2]+'L\012',
'float': save_float, 'float': save_float,
'string': save_string, 'string': save_string,
'reference': save_reference, 'reference': save_reference,
...@@ -730,9 +734,11 @@ def test(): ...@@ -730,9 +734,11 @@ def test():
t=() t=()
l=[] l=[]
s='' s=''
L = long('999999999999')
x.append(t) x.append(t)
x.append(l) x.append(l)
x.append(s) x.append(s)
x.append(L)
x.append(55555) x.append(55555)
x.append(13) x.append(13)
r=[x] r=[x]
...@@ -807,9 +813,11 @@ def test2(): ...@@ -807,9 +813,11 @@ def test2():
t=() t=()
l=[] l=[]
s='' s=''
L = long('999999999999')
x.append(t) x.append(t)
x.append(l) x.append(l)
x.append(s) x.append(s)
x.append(L)
x.append(5) x.append(5)
x.append(13) x.append(13)
print x, '\012' print x, '\012'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment