[pylint] fix detected name errors stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 09 Jun 2010 09:54:35 +0200
branchstable
changeset 5693 8af6623f3d4e
parent 5692 59ceed788bdb
child 5695 85bafafc1f22
[pylint] fix detected name errors
devtools/__init__.py
hooks/notification.py
server/checkintegrity.py
server/sources/storages.py
vregistry.py
web/views/autoform.py
web/views/cwproperties.py
web/views/treeview.py
--- a/devtools/__init__.py	Wed Jun 09 09:42:24 2010 +0200
+++ b/devtools/__init__.py	Wed Jun 09 09:54:35 2010 +0200
@@ -249,7 +249,7 @@
     """initialize a fresh sqlserver databse used for testing purpose"""
     if config.init_repository:
         from cubicweb.server import init_repository
-        init_repository(config, interactive=False, drop=True, vreg=vreg)
+        init_repository(config, interactive=False, drop=True)
 
 ### sqlite test database handling ##############################################
 
--- a/hooks/notification.py	Wed Jun 09 09:42:24 2010 +0200
+++ b/hooks/notification.py	Wed Jun 09 09:54:35 2010 +0200
@@ -188,7 +188,7 @@
         except:
             # may raise an error during deletion process, for instance due to
             # missing required relation
-            title = '#%s' % eid
+            title = '#%s' % self.entity.eid
         self._cw.transaction_data.setdefault('pendingchanges', []).append(
-            ('delete_entity', (self.entity.eid, str(self.entity.e_schema), title)))
+            ('delete_entity', (self.entity.eid, self.entity.__regid__, title)))
         return True
--- a/server/checkintegrity.py	Wed Jun 09 09:42:24 2010 +0200
+++ b/server/checkintegrity.py	Wed Jun 09 09:54:35 2010 +0200
@@ -96,7 +96,7 @@
     cursor = session.pool['system']
     if not repo.system_source.dbhelper.has_fti_table(cursor):
         print 'no text index table'
-        dbhelper.init_fti(cursor)
+        repo.system_source.dbhelper.init_fti(cursor)
     repo.system_source.do_fti = True  # ensure full-text indexation is activated
     etypes = set()
     for eschema in schema.entities():
--- a/server/sources/storages.py	Wed Jun 09 09:42:24 2010 +0200
+++ b/server/sources/storages.py	Wed Jun 09 09:54:35 2010 +0200
@@ -16,11 +16,12 @@
 # You should have received a copy of the GNU Lesser General Public License along
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
 """custom storages for the system source"""
+
 from os import unlink, path as osp
 
 from yams.schema import role_name
 
-from cubicweb import Binary
+from cubicweb import Binary, ValidationError
 from cubicweb.server import hook
 
 def set_attribute_storage(repo, etype, attr, storage):
@@ -157,7 +158,7 @@
         fspath = uniquify_path(self.default_directory, '_'.join(basename))
         if fspath is None:
             msg = entity._cw._('failed to uniquify path (%s, %s)') % (
-                dirpath, '_'.join(basename))
+                self.default_directory, '_'.join(basename))
             raise ValidationError(entity.eid, {role_name(attr, 'subject'): msg})
         return fspath
 
--- a/vregistry.py	Wed Jun 09 09:42:24 2010 +0200
+++ b/vregistry.py	Wed Jun 09 09:54:35 2010 +0200
@@ -29,9 +29,8 @@
   current state (req, rset, row, col). At the end of the selection, if
   a appobject class has been found, an instance of this class is
   returned. The selector is instantiated at appobject registration
-
+"""
 
-"""
 __docformat__ = "restructuredtext en"
 
 import sys
--- a/web/views/autoform.py	Wed Jun 09 09:42:24 2010 +0200
+++ b/web/views/autoform.py	Wed Jun 09 09:54:35 2010 +0200
@@ -128,6 +128,7 @@
 from logilab.common.deprecation import deprecated
 
 from cubicweb import typed_eid, neg_role, uilib
+from cubicweb.vreg import classid
 from cubicweb.schema import display_name
 from cubicweb.view import EntityView
 from cubicweb.selectors import (
@@ -307,7 +308,7 @@
         try:
             cls = self._cw.vreg['etypes'].etype_class(self.etype)
         except:
-            self.w(self._cw._('no such entity type %s') % etype)
+            self.w(self._cw._('no such entity type %s') % self.etype)
             return
         entity = cls(self._cw)
         entity.eid = self._cw.varmaker.next()
@@ -733,7 +734,7 @@
         try:
             srels_by_cat = self.srelations_by_category('generic', 'add', strict=True)
             warn('[3.6] %s: srelations_by_category is deprecated, use uicfg or '
-                 'override editable_relations instead' % classid(form),
+                 'override editable_relations instead' % classid(self),
                  DeprecationWarning)
         except AttributeError:
             srels_by_cat = self.editable_relations()
--- a/web/views/cwproperties.py	Wed Jun 09 09:42:24 2010 +0200
+++ b/web/views/cwproperties.py	Wed Jun 09 09:54:35 2010 +0200
@@ -382,7 +382,7 @@
                 w(u'%s' % self.render_label(form, field))
             error = form.field_error(field)
             if error:
-                w(u'<span class="error">%s</span>' % err)
+                w(u'<span class="error">%s</span>' % error)
             w(u'%s' % self.render_help(form, field))
             w(u'<div class="prefinput">')
             w(field.render(form, self))
--- a/web/views/treeview.py	Wed Jun 09 09:42:24 2010 +0200
+++ b/web/views/treeview.py	Wed Jun 09 09:54:35 2010 +0200
@@ -15,9 +15,8 @@
 #
 # You should have received a copy of the GNU Lesser General Public License along
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
-"""Set of tree-building widgets, based on jQuery treeview plugin
+"""Set of tree-building widgets, based on jQuery treeview plugin"""
 
-"""
 __docformat__ = "restructuredtext en"
 
 from logilab.mtconverter import xml_escape