diff -r be04706eacc9 -r 9aae456abab5 cwconfig.py --- a/cwconfig.py Tue Sep 27 16:04:30 2011 +0200 +++ b/cwconfig.py Wed Sep 28 09:27:42 2011 +0200 @@ -830,6 +830,13 @@ """ return [self.cube_dir(p) for p in self.cubes()] + # these are overridden by set_log_methods below + # only defining here to prevent pylint from complaining + @classmethod + def debug(cls, msg, *a, **kw): + pass + info = warning = error = critical = exception = debug + class CubicWebConfiguration(CubicWebNoAppConfiguration): """base class for cubicweb server and web configurations""" @@ -853,6 +860,9 @@ # wouldn't be possible otherwise repairing = False + # set by upgrade command + verbosity = 0 + options = CubicWebNoAppConfiguration.options + ( ('log-file', {'type' : 'string', @@ -1072,13 +1082,13 @@ @cached def instance_md5_version(self): - import hashlib + from hashlib import md5 # pylint: disable=E0611 infos = [] for pkg in sorted(self.cubes()): version = self.cube_version(pkg) infos.append('%s-%s' % (pkg, version)) infos.append('cubicweb-%s' % str(self.cubicweb_version())) - return hashlib.md5(';'.join(infos)).hexdigest() + return md5(';'.join(infos)).hexdigest() def load_configuration(self): """load instance's configuration files""" @@ -1188,13 +1198,6 @@ SMTP_LOCK.release() return True - # these are overridden by set_log_methods below - # only defining here to prevent pylint from complaining - @classmethod - def debug(cls, msg, *a, **kw): - pass - info = warning = error = critical = exception = debug - set_log_methods(CubicWebNoAppConfiguration, logging.getLogger('cubicweb.configuration')) @@ -1303,7 +1306,7 @@ try: return Binary(fpath) except OSError, ex: - self.critical("can't open %s: %s", fpath, ex) + source.critical("can't open %s: %s", fpath, ex) return None register_function(FSPATH)