Commit 07ba7f50 authored by Jérome Perrin's avatar Jérome Perrin

fixup! XMLExportImport: more support pickle protocol 3 🚧 ( repair python2 )

parent 1e1e062c
...@@ -121,7 +121,7 @@ def unconvert(encoding,S): ...@@ -121,7 +121,7 @@ def unconvert(encoding,S):
else: else:
return str2bytes(eval(b"'" + S.replace(b'\n', b'') + b"'")) return str2bytes(eval(b"'" + S.replace(b'\n', b'') + b"'"))
class Global: class Global(object):
def __init__(self, module, name, mapping): def __init__(self, module, name, mapping):
self.module=module self.module=module
self.name=name self.name=name
...@@ -135,14 +135,14 @@ class Global: ...@@ -135,14 +135,14 @@ class Global:
return '%s<%s%s name="%s" module="%s"/>\n' % ( return '%s<%s%s name="%s" module="%s"/>\n' % (
' '*indent, name, id, self.name, self.module) ' '*indent, name, id, self.name, self.module)
class Immutable: class Immutable(object):
def __init__(self, value): def __init__(self, value):
self.value = value self.value = value
def getValue(self): def getValue(self):
return self.value return self.value
class Scalar: class Scalar(object):
def __init__(self, v, mapping): def __init__(self, v, mapping):
self._v=v self._v=v
self.mapping = mapping self.mapping = mapping
...@@ -215,7 +215,7 @@ class Bytes(String): ...@@ -215,7 +215,7 @@ class Bytes(String):
pass pass
class Wrapper: class Wrapper(object):
def __init__(self, v, mapping): def __init__(self, v, mapping):
self._v=v self._v=v
self.mapping = mapping self.mapping = mapping
...@@ -235,7 +235,7 @@ class Wrapper: ...@@ -235,7 +235,7 @@ class Wrapper:
v=v.__str__(indent+2) v=v.__str__(indent+2)
return '%s<%s%s>\n%s%s</%s>\n' % (i, name, id, v, i, name) return '%s<%s%s>\n%s%s</%s>\n' % (i, name, id, v, i, name)
class Collection: class Collection(object):
def __init__(self, mapping): def __init__(self, mapping):
self.mapping = mapping self.mapping = mapping
...@@ -349,7 +349,7 @@ class Persistent(Wrapper): ...@@ -349,7 +349,7 @@ class Persistent(Wrapper):
return '%s<%s%s>\n%s%s</%s>\n' % (i, name, id, v, i, name) return '%s<%s%s>\n%s%s</%s>\n' % (i, name, id, v, i, name)
blanck_line_expression = re.compile('^ +$') blanck_line_expression = re.compile('^ +$')
class NoBlanks: class NoBlanks(object):
""" """
This allows to ignore at least whitespaces between elements and also This allows to ignore at least whitespaces between elements and also
correctly handle string/unicode correctly handle string/unicode
...@@ -396,7 +396,7 @@ class NoBlanks: ...@@ -396,7 +396,7 @@ class NoBlanks:
self.append(data) self.append(data)
class IdentityMapping: class IdentityMapping(object):
def __init__(self): def __init__(self):
self.resetMapping() self.resetMapping()
self.immutable = {} self.immutable = {}
......
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