Manual pass on sources for better standards.

This commit is contained in:
Alexis Métaireau 2013-03-03 20:12:31 -08:00
commit 519dcdbcb3
9 changed files with 136 additions and 105 deletions

View file

@ -31,11 +31,10 @@ def ansi(color, text):
class ANSIFormatter(Formatter):
"""
Convert a `logging.LogRecord' object into colored text, using ANSI escape sequences.
"""
## colors:
"""Convert a `logging.LogRecord' object into colored text, using ANSI
escape sequences.
"""
def format(self, record):
msg = str(record.msg)
if record.levelname == 'INFO':
@ -67,8 +66,8 @@ class TextFormatter(Formatter):
def init(level=None, logger=getLogger(), handler=StreamHandler()):
logger = logging.getLogger()
if os.isatty(sys.stdout.fileno()) \
and not sys.platform.startswith('win'):
if (os.isatty(sys.stdout.fileno())
and not sys.platform.startswith('win')):
fmt = ANSIFormatter()
else:
fmt = TextFormatter()