Browse Source

lint: logging was not lazy formatting

boyska 7 years ago
parent
commit
77be26ff35

+ 1 - 1
larigira/audiogen_mostrecent.py

@@ -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)

+ 3 - 3
larigira/audiogen_script.py

@@ -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.'

+ 1 - 1
larigira/audiogen_static.py

@@ -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-')

+ 1 - 1
larigira/entrypoints_utils.py

@@ -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()
 
 

+ 2 - 2
larigira/formutils.py

@@ -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))