Commit 85b15963 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[pylint] fix detected name errors

--HG--
branch : stable
parent 59ceed788bdb
......@@ -249,7 +249,7 @@ def init_test_database_sqlserver2005(config):
"""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 ##############################################
......
......@@ -188,7 +188,7 @@ class EntityDeleteHook(SomethingChangedHook):
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
......@@ -96,7 +96,7 @@ def reindex_entities(schema, session, withpb=True):
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():
......
......@@ -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 @@ class BytesFileSystemStorage(Storage):
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
......
......@@ -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
......
......@@ -128,6 +128,7 @@ from logilab.common.decorators import iclassmethod, cached
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 @@ class InlineEntityCreationFormView(InlineEntityEditionFormView):
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 @@ class AutomaticEntityForm(forms.EntityFieldsForm):
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()
......
......@@ -382,7 +382,7 @@ class CWPropertiesFormRenderer(formrenderers.FormRenderer):
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))
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment