[multi-sources-removal] Move cw.server.sources.ConnectionWrapper where it belongs
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Sun, 16 Jun 2013 23:36:06 +0200
changeset 9446 18a186b02970
parent 9445 65d93a4fd11c
child 9447 0636c4960259
[multi-sources-removal] Move cw.server.sources.ConnectionWrapper where it belongs It's only used by the ldap utilities. Related to #2919300
server/ldaputils.py
server/sources/__init__.py
--- a/server/ldaputils.py	Tue Jan 21 17:34:31 2014 +0100
+++ b/server/ldaputils.py	Sun Jun 16 23:36:06 2013 +0200
@@ -41,7 +41,6 @@
 
 from cubicweb import ValidationError, AuthenticationError, Binary
 from cubicweb.server import utils
-from cubicweb.server.sources import ConnectionWrapper
 
 _ = unicode
 
@@ -57,6 +56,20 @@
               }
 
 
+class ConnectionWrapper(object):
+    def __init__(self, cnx=None):
+        self.cnx = cnx
+    def commit(self):
+        pass
+    def rollback(self):
+        pass
+    def cursor(self):
+        return None # no actual cursor support
+    def close(self):
+        if hasattr(self.cnx, 'close'):
+            self.cnx.close()
+
+
 class LDAPSourceMixIn(object):
     """a mix-in for LDAP based source"""
     options = (
--- a/server/sources/__init__.py	Tue Jan 21 17:34:31 2014 +0100
+++ b/server/sources/__init__.py	Sun Jun 16 23:36:06 2013 +0200
@@ -532,19 +532,6 @@
 
 
 
-class ConnectionWrapper(object):
-    def __init__(self, cnx=None):
-        self.cnx = cnx
-    def commit(self):
-        pass
-    def rollback(self):
-        pass
-    def cursor(self):
-        return None # no actual cursor support
-    def close(self):
-        if hasattr(self.cnx, 'close'):
-            self.cnx.close()
-
 from cubicweb.server import SOURCE_TYPES
 
 def source_adapter(source_type):