[CMF-checkins] SVN: CMF/trunk/GenericSetup/utils.py Save the
chickens!
Florent Guillaume
fg at nuxeo.com
Wed Dec 28 20:36:41 EST 2005
Log message for revision 41050:
Save the chickens!
It's not necessary anymore for overriding code to specify again:
node = property(_exportNode, _importNode)
or:
body = property(_exportBody, _importBody)
Changed:
U CMF/trunk/GenericSetup/utils.py
-=-
Modified: CMF/trunk/GenericSetup/utils.py
===================================================================
--- CMF/trunk/GenericSetup/utils.py 2005-12-29 00:45:49 UTC (rev 41049)
+++ CMF/trunk/GenericSetup/utils.py 2005-12-29 01:36:40 UTC (rev 41050)
@@ -434,8 +434,14 @@
"""Import the object from the DOM node.
"""
- node = property(_exportNode, _importNode)
+ def __exportNode(self):
+ return self._exportNode()
+ def __importNode(self, *args):
+ self._importNode(*args)
+
+ node = property(__exportNode, __importNode)
+
def _getObjectNode(self, name, i18n=True):
node = self._doc.createElement(name)
node.setAttribute('name', self.context.getId())
@@ -475,8 +481,14 @@
"""Import the object from the file body.
"""
- body = property(_exportBody, _importBody)
+ def __exportBody(self):
+ return self._exportBody()
+ def __importBody(self, *args):
+ self._importBody(*args)
+
+ body = property(__exportBody, __importBody)
+
mime_type = 'text/plain'
name = ''
@@ -484,7 +496,7 @@
suffix = ''
-class XMLAdapterBase(NodeAdapterBase):
+class XMLAdapterBase(BodyAdapterBase):
"""XML im- and exporter base.
"""
@@ -509,8 +521,6 @@
self._importNode(node.documentElement)
- body = property(_exportBody, _importBody)
-
mime_type = 'text/xml'
name = ''
More information about the CMF-checkins
mailing list