[Erp5-report] r15671 - /erp5/trunk/products/ERP5SyncML/Conduit/

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Aug 14 16:02:36 CEST 2007


Author: fabien
Date: Tue Aug 14 16:02:36 2007
New Revision: 15671

URL: http://svn.erp5.org?rev=15671&view=rev
Log:
- remove som unused import
- use IConduit Interface

Modified:
    erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py
    erp5/trunk/products/ERP5SyncML/Conduit/VCardConduit.py

Modified: erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py?rev=15671&r1=15670&r2=15671&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py (original)
+++ erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py Tue Aug 14 16:02:36 2007
@@ -26,28 +26,21 @@
 #
 ##############################################################################
 
-from Products.ERP5SyncML.SyncCode import SyncCode
 from Products.ERP5SyncML.XMLSyncUtils import XMLSyncUtilsMixin
 from Products.ERP5SyncML.Subscription import Conflict
 from Products.CMFCore.utils import getToolByName
-from Products.ERP5SyncML.XupdateUtils import XupdateUtils
-from Products.ERP5Type.Utils import convertToUpperCase
-from Products.ERP5Type.Accessor.TypeDefinition import list_types
 from Products.ERP5SyncML.XMLSyncUtils import Parse
 from DateTime.DateTime import DateTime
 from email.MIMEBase import MIMEBase
 from email import Encoders
 from AccessControl import ClassSecurityInfo
-from AccessControl.PermissionMapping import setPermissionMapping
-from Products.ERP5Type import Permissions
+from Products.ERP5Type import Permissions, Interface
 from Globals import PersistentMapping
 import pickle
-import string
 from cStringIO import StringIO
 from xml.sax.saxutils import escape, unescape
-import re, copy
+import re
 import cStringIO
-
 from zLOG import LOG, INFO, DEBUG
 try:
   from Ft.Xml.Domlette import Print, PrettyPrint
@@ -61,6 +54,7 @@
     def __init__(self, *args, **kw):
       raise ImportError, "Sorry, it was not possible to import Ft library"
 
+
 class ERP5Conduit(XMLSyncUtilsMixin):
   """
     A conduit is a piece of code in charge of
@@ -96,9 +90,10 @@
     the response of the client, so that we are not sure if it take into account,
     we may have CONFLICT_NOT_SYNCHRONIZED AND CONFLICT_SYNCHRONIZED
     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-
-
   """
+
+  # Declarative interfaces
+  __implements__ = ( Interface.IConduit, )
 
   # Declarative security
   security = ClassSecurityInfo()
@@ -344,10 +339,12 @@
           # This is the place where we should look for conflicts
           # For that we need :
           #   - data : the data from the remote box
-          #   - old_data : the data from this box but at the time of the last synchronization
+          #   - old_data : the data from this box but at the time of the i
+          #last synchronization
           #   - current_data : the data actually on this box
           isConflict = 0
-          if (previous_xml is not None) and (not force): # if no previous_xml, no conflict
+          if (previous_xml is not None) and (not force): 
+          # if no previous_xml, no conflict
             old_data = self.getObjectProperty(keyword, previous_xml, 
                 data_type=data_type)
             #current_data = object.getProperty(keyword)

Modified: erp5/trunk/products/ERP5SyncML/Conduit/VCardConduit.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/Conduit/VCardConduit.py?rev=15671&r1=15670&r2=15671&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/Conduit/VCardConduit.py (original)
+++ erp5/trunk/products/ERP5SyncML/Conduit/VCardConduit.py Tue Aug 14 16:02:36 2007
@@ -1,6 +1,6 @@
 ##############################################################################
 #
-# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
+# Copyright (c) 2007 Nexedi SARL and Contributors. All Rights Reserved.
 #          Fabien Morin <fabien.morin at gmail.com>
 #
 # WARNING: This program as such is intended to be used by professional
@@ -55,7 +55,7 @@
     self.args = {}
 
 
-  security.declareProtected(Permissions.ModifyPortalContent, 'addVCard')
+  security.declareProtected(Permissions.ModifyPortalContent, 'addNode')
   def addNode(self, xml=None, object=None, previous_xml=None, 
       object_id=None, sub_object=None, force=0, simulate=0, **kw):
     """
@@ -80,6 +80,7 @@
     #in a first time, conflict are not used
     return {'conflict_list':None, 'object': new_object}
 
+  security.declareProtected(Permissions.ModifyPortalContent, 'deleteNode')
   def deleteNode(self, xml=None, object=None, object_id=None, force=None, 
       simulate=0, **kw):
     """
@@ -93,6 +94,7 @@
       LOG('VCardConduit',0,'deleteNode, Unable to delete: %s' % str(object_id))
     return conflict_list
 
+  security.declareProtected(Permissions.ModifyPortalContent, 'updateNode')
   def updateNode(self, xml=None, object=None, previous_xml=None, force=0, 
       simulate=0,  **kw):
     """
@@ -118,7 +120,6 @@
     verCTTypeList[self.MEDIA_TYPE['TEXT_VCARD']]=('3.0',)
     verCTTypeList[self.MEDIA_TYPE['TEXT_XVCARD']]=('2.1',)
     return verCTTypeList[capabilities_ct_type]
-
 
   def getPreferedCapabilitieVerCT(self):
     """




More information about the Erp5-report mailing list