[server] use the ClientConnection directly now that it has more methods available
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 05 Mar 2014 10:44:45 +0100
changeset 9555 370a7c40864f
parent 9554 d2fd866f69a2
child 9556 12ee310541bb
[server] use the ClientConnection directly now that it has more methods available Gets rid of ugly self.cnx._cnx.
server/__init__.py
server/migractions.py
--- a/server/__init__.py	Tue Feb 18 17:29:34 2014 +0100
+++ b/server/__init__.py	Wed Mar 05 10:44:45 2014 +0100
@@ -314,7 +314,7 @@
     # so, NO INTEGRITY CHECKS are done, to have quicker db creation.
     # Active integrity is kept else we may pb such as two default
     # workflows for one entity type.
-    with cnx._cnx.deny_all_hooks_but('metadata', 'activeintegrity'):
+    with cnx.deny_all_hooks_but('metadata', 'activeintegrity'):
         # execute cubicweb's pre<event> script
         mhandler.cmd_exec_event_script('pre%s' % event)
         # execute cubes pre<event> script if any
--- a/server/migractions.py	Tue Feb 18 17:29:34 2014 +0100
+++ b/server/migractions.py	Wed Mar 05 10:44:45 2014 +0100
@@ -327,7 +327,7 @@
                         'schema': self.repo.get_schema(),
                         'cnx': self.cnx,
                         'fsschema': self.fs_schema,
-                        'session' : self.cnx._cnx,
+                        'session' : self.cnx,
                         'repo' : self.repo,
                         })
         return context
@@ -1434,7 +1434,7 @@
         """
         if not ask_confirm or self.confirm('Execute sql: %s ?' % sql):
             try:
-                cu = self.cnx._cnx.system_sql(sql, args)
+                cu = self.cnx.system_sql(sql, args)
             except Exception:
                 ex = sys.exc_info()[1]
                 if self.confirm('Error: %s\nabort?' % ex, pdb=True):