Browse Source

lint: replace deprecated worn warn() w/ warning()

boyska 7 years ago
parent
commit
7f78bee6ff

+ 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.warning("Can't find requested path: %s", path)
             continue
         if os.path.isfile(path):
             found_files[path] = get_mtime(path)

+ 1 - 1
larigira/audiogen_randomdir.py

@@ -23,7 +23,7 @@ def generate(spec):
     found_files = set()
     for path in spec['paths']:
         if not os.path.exists(path):
-            logging.warn("Can't find requested path: %s", path)
+            logging.warning("Can't find requested path: %s", path)
             continue
         if os.path.isfile(path):
             found_files.add(path)

+ 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.warning("Can't find requested path: %s", path)
             continue
         tmp = mkstemp(suffix=os.path.splitext(path)[-1],
                       prefix='audiogen-static-')

+ 2 - 2
larigira/dbadmin/suggestions.py

@@ -15,7 +15,7 @@ def get_suggested_files():
     files = []
     for path in get_conf()['FILE_PATH_SUGGESTION']:
         if not os.path.isdir(path):
-            current_app.logger.warn('Invalid suggestion path: %s' % path)
+            current_app.logger.warning('Invalid suggestion path: %s' % path)
             continue
         pathfiles = scan_dir_audio(path)
         files.extend(pathfiles)
@@ -51,7 +51,7 @@ def get_suggested_scripts():
 def get_suggestions():
     files = get_suggested_files()
     if len(files) > 200:
-        current_app.logger.warn("Too many suggested files, cropping")
+        current_app.logger.warning("Too many suggested files, cropping")
         files = files[:200]
     return dict(
         files=files,

+ 3 - 3
larigira/event.py

@@ -174,9 +174,9 @@ class Monitor(ParentedLet):
         if timespec.eid in self.running:
             del self.running[timespec.eid]
         else:
-            self.log.warn('Timespec %s completed but not in running '
-                          'registry; this is most likely a bug',
-                          timespec.get('nick', timespec.eid))
+            self.log.warning('Timespec %s completed but not in running '
+                             'registry; this is most likely a bug',
+                             timespec.get('nick', timespec.eid))
         uris = []
         for audiospec in audiospecs:
             try:

+ 1 - 1
larigira/rpc.py

@@ -134,7 +134,7 @@ def rpc_wip():
             if obid in roots:
                 continue
             if obid not in tree:
-                current_app.logger.warn('How strange, {} not in tree'
+                current_app.logger.warning('How strange, {} not in tree'
                                         .format(obid))
                 continue
             tree[tree[obid]['parent']]['children'][obid] = tree[obid]