]> git.lizzy.rs Git - nhentai.git/blobdiff - nhentai/logger.py
project is now Py3 and Py2 compatible
[nhentai.git] / nhentai / logger.py
index 7d62582529803ac3050e64396976e3f753088fa8..88273ab844a3a31c2bcfe2faa64376de54f219cb 100644 (file)
@@ -1,4 +1,3 @@
-import logging
 #
 # Copyright (C) 2010-2012 Vinay Sajip. All rights reserved. Licensed under the new BSD license.
 #
@@ -75,7 +74,7 @@ class ColorizingStreamHandler(logging.StreamHandler):
             if fd is not None:
                 fd = fd()
 
-                if fd in (1, 2): # stdout or stderr
+                if fd in (1, 2):  # stdout or stderr
                     h = ctypes.windll.kernel32.GetStdHandle(-10 - fd)
 
             while parts:
@@ -97,11 +96,11 @@ class ColorizingStreamHandler(logging.StreamHandler):
                             elif 30 <= p <= 37:
                                 color |= self.nt_color_map[p - 30]
                             elif p == 1:
-                                color |= 0x08 # foreground intensity on
-                            elif p == 0: # reset to default color
+                                color |= 0x08  # foreground intensity on
+                            elif p == 0:  # reset to default color
                                 color = 0x07
                             else:
-                                pass # error condition ignored
+                                pass  # error condition ignored
 
                         ctypes.windll.kernel32.SetConsoleTextAttribute(h, color)
 
@@ -127,7 +126,7 @@ class ColorizingStreamHandler(logging.StreamHandler):
                     prefix = ""
 
                 message = "%s%s" % (prefix, ''.join((self.csi, ';'.join(params),
-                                   'm', message, self.reset)))
+                                    'm', message, self.reset)))
 
         return message