help pylint by explicitely defining some attributes
* the logging functions automatically set by set_log_methods
* the attributes of Hook classes (eidfrom, entity...):
--- a/appobject.py Fri Mar 11 09:46:45 2011 +0100
+++ b/appobject.py Wed Mar 16 09:37:46 2011 +0100
@@ -576,4 +576,8 @@
def propval(self, propid):
return self._cw.property_value(self._cwpropkey(propid))
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
+
set_log_methods(AppObject, getLogger('cubicweb.appobject'))
--- a/cwconfig.py Fri Mar 11 09:46:45 2011 +0100
+++ b/cwconfig.py Wed Mar 16 09:37:46 2011 +0100
@@ -1182,6 +1182,10 @@
SMTP_LOCK.release()
return True
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
+
set_log_methods(CubicWebNoAppConfiguration,
logging.getLogger('cubicweb.configuration'))
--- a/dbapi.py Fri Mar 11 09:46:45 2011 +0100
+++ b/dbapi.py Wed Mar 16 09:37:46 2011 +0100
@@ -376,6 +376,9 @@
def del_session_data(self, key):
self.session.data.pop(key, None)
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
set_log_methods(DBAPIRequest, getLogger('cubicweb.dbapi'))
--- a/migration.py Fri Mar 11 09:46:45 2011 +0100
+++ b/migration.py Wed Mar 16 09:37:46 2011 +0100
@@ -434,6 +434,9 @@
if exists(newconfig):
os.unlink(newconfig)
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
from logging import getLogger
from cubicweb import set_log_methods
--- a/rtags.py Fri Mar 11 09:46:45 2011 +0100
+++ b/rtags.py Wed Mar 16 09:37:46 2011 +0100
@@ -160,6 +160,9 @@
return self.get(etype, rtype, ttype, role)
return self.get(ttype, rtype, etype, role)
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
class RelationTagsSet(RelationTags):
--- a/schema.py Fri Mar 11 09:46:45 2011 +0100
+++ b/schema.py Wed Mar 16 09:37:46 2011 +0100
@@ -934,6 +934,10 @@
def minimal_rql(self):
return 'Any %s WHERE %s' % (self.mainvars, self.expression)
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
+
class ERQLExpression(RQLExpression):
def __init__(self, expression, mainvars=None, eid=None):
@@ -1094,6 +1098,9 @@
"""called when a file without handler associated has been found"""
self.warning('ignoring file %r', filepath)
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
class CubicWebSchemaLoader(BootstrapSchemaLoader):
"""cubicweb specific schema loader, automatically adding metadata to the
@@ -1131,6 +1138,9 @@
self.info('loading %s', filepath)
self.handle_file(filepath)
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
set_log_methods(CubicWebSchemaLoader, getLogger('cubicweb.schemaloader'))
set_log_methods(BootstrapSchemaLoader, getLogger('cubicweb.bootstrapschemaloader'))
--- a/server/hook.py Fri Mar 11 09:46:45 2011 +0100
+++ b/server/hook.py Wed Mar 16 09:37:46 2011 +0100
@@ -454,6 +454,9 @@
order = 0
# XXX deprecated
enabled = True
+ # stop pylint from complaining about missing attributes in Hooks classes
+ eidfrom = eidto = entity = rtype = None
+
@classmethod
def check_events(cls):
@@ -757,6 +760,10 @@
def config(self):
return self.session.repo.config
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
+
set_log_methods(Operation, getLogger('cubicweb.session'))
def _container_add(container, value):
--- a/server/querier.py Fri Mar 11 09:46:45 2011 +0100
+++ b/server/querier.py Wed Mar 16 09:37:46 2011 +0100
@@ -747,6 +747,10 @@
# return a result set object
return ResultSet(results, rql, args, descr, orig_rqlst)
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
+
from logging import getLogger
from cubicweb import set_log_methods
LOGGER = getLogger('cubicweb.querier')
--- a/server/repository.py Fri Mar 11 09:46:45 2011 +0100
+++ b/server/repository.py Wed Mar 16 09:37:46 2011 +0100
@@ -1471,6 +1471,9 @@
if not source is self.system_source
and source.support_relation(rtype))
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
def pyro_unregister(config):
"""unregister the repository from the pyro name server"""
--- a/server/session.py Fri Mar 11 09:46:45 2011 +0100
+++ b/server/session.py Wed Mar 16 09:37:46 2011 +0100
@@ -1032,6 +1032,10 @@
"""return a result set for the given eid"""
return self.entity_from_eid(eid)
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
+
class InternalSession(Session):
"""special session created internaly by the repository"""
--- a/server/sqlutils.py Fri Mar 11 09:46:45 2011 +0100
+++ b/server/sqlutils.py Wed Mar 16 09:37:46 2011 +0100
@@ -284,6 +284,9 @@
attrs[SQL_PREFIX+'eid'] = entity.eid
return attrs
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
from logging import getLogger
from cubicweb import set_log_methods
--- a/vregistry.py Fri Mar 11 09:46:45 2011 +0100
+++ b/vregistry.py Wed Mar 16 09:37:46 2011 +0100
@@ -237,6 +237,10 @@
select_best = deprecated('[3.6] select_best is now private')(_select_best)
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
+
class VRegistry(dict):
"""class responsible to register, propose and select the various
@@ -517,6 +521,9 @@
raise
self.exception('appobject %s registration failed: %s',
appobjectcls, ex)
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
# init logging
--- a/web/application.py Fri Mar 11 09:46:45 2011 +0100
+++ b/web/application.py Wed Mar 16 09:37:46 2011 +0100
@@ -234,6 +234,9 @@
req.remove_cookie(req.get_cookie(), sessioncookie)
raise LogOut(url=goto_url)
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
class CubicWebPublisher(object):
"""the publisher is a singleton hold by the web frontend, and is responsible
@@ -458,6 +461,9 @@
template = 'main-template'
return template
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
set_log_methods(CubicWebPublisher, LOGGER)
set_log_methods(CookieSessionHandler, LOGGER)
--- a/web/propertysheet.py Fri Mar 11 09:46:45 2011 +0100
+++ b/web/propertysheet.py Wed Mar 16 09:37:46 2011 +0100
@@ -115,6 +115,10 @@
def compile(self, content):
return self._percent_rgx.sub('%%', content) % self
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
+
from cubicweb.web import LOGGER
from logilab.common.logging_ext import set_log_methods
set_log_methods(PropertySheet, LOGGER)
--- a/wsgi/handler.py Fri Mar 11 09:46:45 2011 +0100
+++ b/wsgi/handler.py Wed Mar 16 09:37:46 2011 +0100
@@ -193,6 +193,10 @@
content = self.appli.need_login_content(req)
return WSGIResponse(code, req, content)
+ # these are overridden by set_log_methods below
+ # only defining here to prevent pylint from complaining
+ info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
+
from logging import getLogger
from cubicweb import set_log_methods