typos, api update
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 09 Dec 2009 17:48:04 +0100
changeset 4089 ff92c7d692bf
parent 4088 23ce2b3fb03d
child 4090 9191f6106795
typos, api update
hooks/test/unittest_hooks.py
schemaviewer.py
server/repository.py
server/test/unittest_ldapuser.py
web/component.py
web/facet.py
web/views/wdoc.py
--- a/hooks/test/unittest_hooks.py	Wed Dec 09 17:10:01 2009 +0100
+++ b/hooks/test/unittest_hooks.py	Wed Dec 09 17:48:04 2009 +0100
@@ -441,7 +441,7 @@
             self.failIf(self.index_exists('Workflow', 'name'))
         finally:
             self.execute('SET X indexed TRUE WHERE X relation_type R, R name "name"')
-            self.failIf(self.schema['name'].rproperty('Workflow', 'String').indexed)
+            self.failIf(self.schema['name'].rdef('Workflow', 'String').indexed)
             self.failIf(self.index_exists('Workflow', 'name'))
             self.commit()
             self.failUnless(self.schema['name'].rdef('Workflow', 'String').indexed)
--- a/schemaviewer.py	Wed Dec 09 17:10:01 2009 +0100
+++ b/schemaviewer.py	Wed Dec 09 17:48:04 2009 +0100
@@ -203,7 +203,7 @@
                     done.add((objtype, subjtype))
                 data.append(Link(self.eschema_link_url(schema[subjtype]), subjtype))
                 data.append(Link(self.eschema_link_url(schema[objtype]), objtype))
-                rdef = rschema.rdef(subjtype, objtypep)
+                rdef = rschema.rdef(subjtype, objtype)
                 for prop in properties:
                     val = getattr(rdef, prop)
                     if val is None:
--- a/server/repository.py	Wed Dec 09 17:10:01 2009 +0100
+++ b/server/repository.py	Wed Dec 09 17:48:04 2009 +0100
@@ -542,11 +542,12 @@
         # use an internal connection
         session = self.internal_session()
         # try to get a user object
+        cnxprops = kwargs.pop('cnxprops', None)
         try:
             user = self.authenticate_user(session, login, **kwargs)
         finally:
             session.close()
-        session = Session(user, self, kwargs.get('cnxprops'))
+        session = Session(user, self, cnxprops)
         user._cw = user.cw_rset.req = session
         user.clear_related_cache()
         self._sessions[session.id] = session
--- a/server/test/unittest_ldapuser.py	Wed Dec 09 17:10:01 2009 +0100
+++ b/server/test/unittest_ldapuser.py	Wed Dec 09 17:48:04 2009 +0100
@@ -23,7 +23,7 @@
     ADIM = 'adimascio'
 
 
-def nopwd_authenticate(self, session, login, upassword):
+def nopwd_authenticate(self, session, login, password):
     """used to monkey patch the source to get successful authentication without
     upassword checking
     """
@@ -162,7 +162,7 @@
         syt = self.sexecute('CWUser X WHERE X login %(login)s', {'login': SYT}).get_entity(0, 0)
         self.assertEquals([g.name for g in syt.in_group], ['managers', 'users'])
         self.patch_authenticate()
-        cnx = self.login(SYT, 'dummypassword')
+        cnx = self.login(SYT, password='dummypassword')
         cu = cnx.cursor()
         adim = cu.execute('CWUser X WHERE X login %(login)s', {'login': ADIM}).get_entity(0, 0)
         adim.fire_transition('deactivate')
@@ -183,7 +183,7 @@
             self.restore_connection()
             adim = self.sexecute('CWUser X WHERE X login %(login)s', {'login': ADIM}).get_entity(0, 0)
             adim.fire_transition('activate')
-            self.execute('DELETE X in_group G WHERE X login %(syt)s, G name "managers"', {'syt': SYT})
+            self.sexecute('DELETE X in_group G WHERE X login %(syt)s, G name "managers"', {'syt': SYT})
 
     def test_same_column_names(self):
         self.sexecute('Any X, Y WHERE X copain Y, X login "comme", Y login "cochon"')
@@ -193,8 +193,9 @@
         self.failUnless(self.sexecute('Any X,Y WHERE X login %(syt)s, Y login "cochon"', {'syt': SYT}))
 
     def test_exists1(self):
-        self.add_entity('CWGroup', name=u'bougloup1', req=self.session)
-        self.add_entity('CWGroup', name=u'bougloup2', req=self.session)
+        self.session.set_pool()
+        self.session.create_entity('CWGroup', name=u'bougloup1')
+        self.session.create_entity('CWGroup', name=u'bougloup2')
         self.sexecute('SET U in_group G WHERE G name ~= "bougloup%", U login "admin"')
         self.sexecute('SET U in_group G WHERE G name = "bougloup1", U login %(syt)s', {'syt': SYT})
         rset = self.sexecute('Any L,SN ORDERBY L WHERE X in_state S, S name SN, X login L, EXISTS(X in_group G, G name ~= "bougloup%")')
--- a/web/component.py	Wed Dec 09 17:10:01 2009 +0100
+++ b/web/component.py	Wed Dec 09 17:48:04 2009 +0100
@@ -104,7 +104,7 @@
             start = int(self._cw.form[self.start_param])
         except KeyError:
             start, stop = 0, self.page_size
-        if start >= len(self.rset):
+        if start >= len(self.cw_rset):
             start, stop = 0, self.page_size
         self.starting_from = start
         return start, stop
--- a/web/facet.py	Wed Dec 09 17:10:01 2009 +0100
+++ b/web/facet.py	Wed Dec 09 17:48:04 2009 +0100
@@ -420,7 +420,7 @@
                         continue
                 elif not rdef.object in possibletypes:
                     continue
-            if rdef.role_cardinality(role) in '+*':
+            if rdef.role_cardinality(self.role) in '+*':
                 return True
         return False
 
--- a/web/views/wdoc.py	Wed Dec 09 17:10:01 2009 +0100
+++ b/web/views/wdoc.py	Wed Dec 09 17:48:04 2009 +0100
@@ -194,7 +194,7 @@
         restdata = ['.. -*- coding: utf-8 -*-', '', title, '='*len(title), '']
         w = restdata.append
         today = date.today()
-        for fpath in self._cw.config.locate_all_files(rid):
+        for fpath in self._cw.vreg.config.locate_all_files(rid):
             cl = ChangeLog(fpath)
             encoding = 'utf-8'
             # additional content may be found in title