lint: logging was not lazy formatting

This commit is contained in:
boyska 2017-01-19 11:11:36 +01:00
parent 6756432ce0
commit 77be26ff35
No known key found for this signature in database
GPG key ID: 7395DCAE58289CA9
5 changed files with 8 additions and 8 deletions

View file

@ -17,7 +17,7 @@ def recent_choose(paths, howmany, minepoch):
found_files = {}
for path in paths:
if not os.path.exists(path):
logging.warn("Can't find requested path: %s" % path)
logging.warn("Can't find requested path:,s" % path)
continue
if os.path.isfile(path):
found_files[path] = get_mtime(path)

View file

@ -65,13 +65,13 @@ def generate(spec):
env=env,
cwd='/')
except subprocess.CalledProcessError as exc:
log.error("Error %d when running script %s" %
(exc.returncode, spec['name']))
log.error("Error %d when running script %s",
exc.returncode, spec['name'])
return []
out = out.decode('utf-8')
out = [p for p in out.split('\n') if p]
logging.debug('Script %s produced %d files' % (spec['name'], len(out)))
logging.debug('Script %s produced %d files', spec['name'], len(out))
return out
generate.description = 'Generate audio through an external script. ' \
'Experts only.'

View file

@ -15,7 +15,7 @@ def generate(spec):
for path in spec['paths']:
if not os.path.exists(path):
logging.warn("Can't find requested path: %s" % path)
logging.warn("Can't find requested path: %s", path)
continue
tmp = mkstemp(suffix=os.path.splitext(path)[-1],
prefix='audiogen-static-')

View file

@ -9,7 +9,7 @@ def get_one_entrypoint(group, kind):
if not points:
raise ValueError('cant find an entrypoint %s:%s' % (group, kind))
if len(points) > 1:
log.warning("Found more than one timeform for %s:%s" % (group, kind))
log.warning("Found more than one timeform for %s:%s", group, kind)
return points[0].load()

View file

@ -68,7 +68,7 @@ class EasyDateTimeField(Field):
self.data = datetime.strptime(date_str, fmt)
return
except ValueError:
log.debug('Format `%s` not valid for `%s`' %
(fmt, date_str))
log.debug('Format `%s` not valid for `%s`',
fmt, date_str)
raise ValueError(self.gettext(
'Not a valid datetime value <tt>{}</tt>').format(date_str))