Ver Fonte

Making pylint happy

Cammy há 6 anos atrás
pai
commit
468aa0fd33
2 ficheiros alterados com 9 adições e 7 exclusões
  1. 2 2
      pyinstalive/comments.py
  2. 7 5
      pyinstalive/dlfuncs.py

+ 2 - 2
pyinstalive/comments.py

@@ -123,7 +123,7 @@ class CommentsDownloader(object):
         python_version = sys.version.split(' ')[0]
         comments_timeline = {}
         wide_build = sys.maxunicode > 65536
-        for i, c in enumerate(comments):
+        for c in comments:
             if 'offset' in c:
                 for k in c.get('comment').keys():
                     c[k] = c.get('comment', {}).get(k)
@@ -138,7 +138,7 @@ class CommentsDownloader(object):
             total_comments = 0
             timestamps = sorted(comments_timeline.keys())
             subs = []
-            for i, tc in enumerate(timestamps):
+            for tc in timestamps:
                 t = comments_timeline[tc]
                 clip_start = int(tc) - int(download_start_time) + int(comments_delay)
                 if clip_start < 0:

+ 7 - 5
pyinstalive/dlfuncs.py

@@ -51,7 +51,7 @@ def get_stream_duration(duration_type):
         if stream_started_secs:
             stream_duration_str += ' and %d seconds' % stream_started_secs
         return stream_duration_str
-    except Exception as e:
+    except Exception:
         return "Not available"
 
 
@@ -110,6 +110,9 @@ def get_broadcasts_info():
             return True
         else:
             return False
+    except ClientThrottledError:
+        logger.error('Could not check because you are making too many requests at this time.')
+        return False
     except Exception as e:
         logger.error('Could not finish checking: {:s}'.format(str(e)))
         if "timed out" in str(e):
@@ -119,10 +122,7 @@ def get_broadcasts_info():
                          'again.')
         return False
     except KeyboardInterrupt:
-        logger.binfo('Aborted checking for livestreams and replays, exiting.'.format(pil.dl_user))
-        return False
-    except ClientThrottledError as cte:
-        logger.error('Could not check because you are making too many requests at this time.')
+        logger.binfo('Aborted checking for livestreams and replays, exiting.')
         return False
 
 
@@ -302,6 +302,8 @@ def download_replays():
                 directories = (os.walk(pil.dl_path).__next__()[1])
 
             for directory in directories:
+                if pil.verbose:
+                    logger.plain(directory)
                 if (str(replay_obj.get('id')) in directory) and ("_live_" not in directory):
                     logger.binfo("Already downloaded a replay with ID '{:s}'.".format(str(replay_obj.get('id'))))
                     exists = True