minor cleanups
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 03 Apr 2014 18:18:11 +0200
changeset 9630 e7dbc4f06a48
parent 9629 8114bed10e78
child 9631 c51a05b5dcb8
minor cleanups
devtools/testlib.py
repoapi.py
server/migractions.py
server/session.py
--- a/devtools/testlib.py	Thu Apr 03 18:16:28 2014 +0200
+++ b/devtools/testlib.py	Thu Apr 03 18:18:11 2014 +0200
@@ -215,19 +215,19 @@
             repo._sessions[self._session.sessionid] = self._session
             self._session.user._cw = self._session
 
-    @ contextmanager
+    @contextmanager
     def repo_cnx(self):
         """Context manager returning a server side connection for the user"""
         with self._session.new_cnx() as cnx:
             yield cnx
 
-    @ contextmanager
+    @contextmanager
     def client_cnx(self):
         """Context manager returning a client side connection for the user"""
         with repoapi.ClientConnection(self._session) as cnx:
             yield cnx
 
-    @ contextmanager
+    @contextmanager
     def web_request(self, url=None, headers={}, method='GET', **kwargs):
         """Context manager returning a web request pre-linked to a client cnx
 
@@ -287,6 +287,7 @@
         super(CubicWebTC, self).__init__(*args, **kwargs)
 
     # repository connection handling ###########################################
+
     def new_access(self, login):
         """provide a new RepoAccess object for a given user
 
--- a/repoapi.py	Thu Apr 03 18:16:28 2014 +0200
+++ b/repoapi.py	Thu Apr 03 18:18:11 2014 +0200
@@ -380,7 +380,7 @@
     def cursor(self):
         return self
 
-    @ property
+    @property
     @deprecated('[3.19] This is a repoapi.ClientConnection object not a dbapi one')
     def sessionid(self):
         return self._session.sessionid
--- a/server/migractions.py	Thu Apr 03 18:16:28 2014 +0200
+++ b/server/migractions.py	Thu Apr 03 18:18:11 2014 +0200
@@ -78,6 +78,7 @@
         if not cls.__regid__ in repo.vreg['after_add_entity_hooks']:
             repo.vreg.register(ClearGroupMap)
 
+
 class ServerMigrationHelper(MigrationHelper):
     """specific migration helper for server side migration scripts,
     providing actions related to schema/data migration
--- a/server/session.py	Thu Apr 03 18:16:28 2014 +0200
+++ b/server/session.py	Thu Apr 03 18:18:11 2014 +0200
@@ -382,6 +382,7 @@
         return func(cnx, *args, **kwargs)
     return check_open
 
+
 class Connection(RequestSessionBase):
     """Repository Connection
 
@@ -1371,7 +1372,7 @@
         return float(self._timestamp)
 
     @property
-    @deprecated('[3.19] session.id is deprecated. use session.sessionid')
+    @deprecated('[3.19] session.id is deprecated, use session.sessionid')
     def id(self):
         return self.sessionid