[Erp5-report] r15652 - /erp5/trunk/products/ERP5SyncML/

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Aug 13 17:30:17 CEST 2007


Author: fabien
Date: Mon Aug 13 17:30:16 2007
New Revision: 15652

URL: http://svn.erp5.org?rev=15652&view=rev
Log:
- put an authentication type and format by default (if nothing is enter)
- remove useless method

Modified:
    erp5/trunk/products/ERP5SyncML/Publication.py
    erp5/trunk/products/ERP5SyncML/Subscription.py
    erp5/trunk/products/ERP5SyncML/SynchronizationTool.py

Modified: erp5/trunk/products/ERP5SyncML/Publication.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/Publication.py?rev=15652&r1=15651&r2=15652&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/Publication.py (original)
+++ erp5/trunk/products/ERP5SyncML/Publication.py Mon Aug 13 17:30:16 2007
@@ -165,8 +165,8 @@
     self.setConduit(conduit)
     Folder.__init__(self, id)
     self.title = title
-    self.authentication_format = authentication_format
-    self.authentication_type = authentication_type
+    self.setAuthenticationFormat(authentication_format)
+    self.setAuthenticationType(authentication_type)
     self.setSyncContentType(sync_content_type)
     self.setSynchronizeWithERP5Sites(synchronize_with_erp5_sites)
 
@@ -188,30 +188,6 @@
       return the publication url
     """
     self.publication_url = publication_url
-
-  def getAuthenticationFormat(self):
-    """
-      return the format of authentication
-    """
-    return getattr(self, 'authentication_format', '')
-
-  def getAuthenticationType(self):
-    """
-      return the type of authentication
-    """
-    return getattr(self, 'authentication_type', '')
-
-  def setAuthenticationFormat(self, authentication_format):
-    """
-      set the format of authentication
-    """
-    self.authentication_format = authentication_format
-
-  def setAuthenticationType(self, authentication_type):
-    """
-      set the type of authentication
-    """
-    self.authentication_type = authentication_type
 
   def addSubscriber(self, subscriber):
     """

Modified: erp5/trunk/products/ERP5SyncML/Subscription.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/Subscription.py?rev=15652&r1=15651&r2=15652&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/Subscription.py (original)
+++ erp5/trunk/products/ERP5SyncML/Subscription.py Mon Aug 13 17:30:16 2007
@@ -1015,13 +1015,19 @@
     """
       set the format of authentication
     """
-    self.authentication_format = authentication_format
+    if authentication_format in (None, ''):
+      self.authentication_format = 'b64'
+    else:
+      self.authentication_format=authentication_format
 
   def setAuthenticationType(self, authentication_type):
     """
       set the type of authentication
     """
-    self.authentication_type = authentication_type
+    if authentication_type in (None, ''):
+      self.authentication_type = 'syncml:auth-basic'
+    else:
+      self.authentication_type = authentication_type
 
   def getGidFromObject(self, object):
     """

Modified: erp5/trunk/products/ERP5SyncML/SynchronizationTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/SynchronizationTool.py?rev=15652&r1=15651&r2=15652&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/SynchronizationTool.py (original)
+++ erp5/trunk/products/ERP5SyncML/SynchronizationTool.py Mon Aug 13 17:30:16 2007
@@ -179,8 +179,9 @@
             destination_path, source_uri, query, xml_mapping, 
             conduit, gpg_key, 
             synchronization_id_generator=None, gid_generator=None, 
-            media_type=None, authentication_format='', 
-            authentication_type='', RESPONSE=None, activity_enabled = False,
+            media_type=None, authentication_format='b64', 
+            authentication_type='syncml:auth-basic', 
+            RESPONSE=None, activity_enabled = False,
             sync_content_type='application/vnd.syncml+xml', 
             synchronize_with_erp5_sites=True):
     """
@@ -195,7 +196,8 @@
                       destination_path, source_uri, query, xml_mapping,
                       conduit, gpg_key, synchronization_id_generator,
                       gid_generator, media_type, 
-                      authentication_format, authentication_type,
+                      authentication_format, 
+                      authentication_type,
                       activity_enabled, synchronize_with_erp5_sites,
                       sync_content_type)
     folder._setObject( new_id, pub )
@@ -244,7 +246,8 @@
                             destination_path, source_uri, query, xml_mapping,
                             conduit, gpg_key, synchronization_id_generator,
                             gid_generator,  media_type=None,
-                            authentication_format='', authentication_type='',
+                            authentication_format='b64', 
+                            authentication_type='syncml:auth-basic',
                             RESPONSE=None, activity_enabled=False,
                             sync_content_type='application/vnd.syncml+xml',
                             synchronize_with_erp5_sites=False):




More information about the Erp5-report mailing list