[Zope-CVS] SVN: ldapadapter/trunk/utility.py Move code around to the class it belongs to.

Florent Guillaume fg at nuxeo.com
Mon Oct 11 06:00:12 EDT 2004


Log message for revision 27950:
  Move code around to the class it belongs to.
  


Changed:
  U   ldapadapter/trunk/utility.py


-=-
Modified: ldapadapter/trunk/utility.py
===================================================================
--- ldapadapter/trunk/utility.py	2004-10-11 09:54:22 UTC (rev 27949)
+++ ldapadapter/trunk/utility.py	2004-10-11 10:00:11 UTC (rev 27950)
@@ -87,27 +87,7 @@
         proto =  self.useSSL and 'ldaps' or 'ldap'
         return '%s://%s:%s' % (proto, self.host, self.port)
 
-    def _setServerURL(self, url):
-        """Set the server info from an LDAP URL.
 
-        An LDAP url is of the form ldap[s]://host:port
-        """
-        port = 389
-        url = url.strip()
-        urlList = url.split(':')
-        if len(urlList) >= 2:
-            useSSL = urlList[0].endswith('s')
-            host = urlList[1][2:]
-            if len(urlList) == 3:
-                port = int(urlList[2])
-        else:
-            LDAPURIParseError(LDAP_uri_parse_error)
-
-        self.host = host
-        self.port = port
-        self.useSSL = useSSL
-
-
 class LDAPConnection(object):
     implements(ILDAPConnection)
 
@@ -173,6 +153,24 @@
     """
     implements(IManageableLDAPAdapter)
 
-    serverURL = property(LDAPAdapter.getServerURL, LDAPAdapter._setServerURL)
-    bindDN = u''
-    bindPassword = u''
+    def _setServerURL(self, url):
+        """Set the server info from an LDAP URL.
+
+        An LDAP url is of the form ldap[s]://host:port
+        """
+        port = 389
+        url = url.strip()
+        urlList = url.split(':')
+        if len(urlList) >= 2:
+            useSSL = urlList[0].endswith('s')
+            host = urlList[1][2:]
+            if len(urlList) == 3:
+                port = int(urlList[2])
+        else:
+            LDAPURIParseError(LDAP_uri_parse_error)
+
+        self.host = host
+        self.port = port
+        self.useSSL = useSSL
+
+    serverURL = property(LDAPAdapter.getServerURL, _setServerURL)



More information about the Zope-CVS mailing list