From facc3fe261de0e6a7c92f891d8f291961a8c4caa Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Fri, 8 Oct 2004 14:51:11 +0000
Subject: [PATCH] the xml export was still broken, because of problem of import

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1831 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/ZopePatch.py | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/product/ERP5Type/ZopePatch.py b/product/ERP5Type/ZopePatch.py
index 8c6b9e0bf4..34e2389e94 100755
--- a/product/ERP5Type/ZopePatch.py
+++ b/product/ERP5Type/ZopePatch.py
@@ -934,6 +934,12 @@ XMLrecord = PatchedXMLrecord
 
 ######################################################################################
 # Shared/DC/xml/ppml patch
+
+
+# Import everything right now, not after
+# or new patch will not work
+from Shared.DC.xml.ppml import *
+
 class Global:
 
     def __init__(self, module, name, mapping):
@@ -1123,6 +1129,8 @@ class Reference(Scalar):
         return '%s<%s id="%s"/>\n' % (' '*indent,name,self.mapping[v])
 
 ppml.Reference = Reference
+Get = Reference
+ppml.Get = Get
 
 class Object(Sequence):
     def __init__(self, klass, args, mapping):
@@ -1207,7 +1215,25 @@ class MinimalMapping(IdentityMapping):
 
 ppml.MinimalMapping = MinimalMapping
 
-from Shared.DC.xml.ppml import *
+class List(Sequence): pass
+class Tuple(Sequence): pass
+
+class Klass(Wrapper): pass
+class State(Wrapper): pass
+class Pickle(Wrapper): pass
+
+class Int(Scalar): pass
+class Float(Scalar): pass
+
+class Key(Wrapper): pass
+class Value(Wrapper): pass
+
+class Long(Scalar):
+    def value(self):
+        result = str(self._v)
+        if result[-1:] == 'L':
+            return result[:-1]
+        return result
 
 class ToXMLUnpickler(Unpickler):
 
@@ -1288,6 +1314,8 @@ class ToXMLUnpickler(Unpickler):
 
     def load_tuple(self):
         k = self.marker()
+        LOG('load_tuple, k',0,k)
+        LOG('load_tuple, stack[k+1:]',0,self.stack[k+1:])
         self.stack[k:] = [Tuple(self.id_mapping, v=self.stack[k+1:])]
     dispatch[TUPLE] = load_tuple
 
@@ -1523,3 +1551,7 @@ class xmlPickler(NoBlanks, xyap):
         }
 
 ppml.xmlPickler = xmlPickler
+
+class Tuple(Sequence): pass
+
+ppml.Tuple = Tuple
-- 
2.30.9