bug fix. Added PythonInstaller class.

This commit is contained in:
utahta
2010-11-13 21:24:37 +09:00
parent b357cc13ff
commit 97b101f33c
43 changed files with 4458 additions and 167 deletions
+10 -10
View File
@@ -1,6 +1,14 @@
import sys
import logging
class LoggerInfo(object):
def log(self, level, msg, *arg, **keys):
sys.stdout.write("%s\n" % msg)
class LoggerError(object):
def log(self, level, msg, *arg, **keys):
sys.stderr.write("ERROR: %s\n" % msg)
class Logger(object):
DEBUG = logging.DEBUG
@@ -9,18 +17,10 @@ class Logger(object):
def __init__(self):
self._consumers = []
consumer = logging.getLogger('info')
consumer.setLevel(Logger.INFO)
hdlr = logging.StreamHandler(sys.stdout)
hdlr.setFormatter(logging.Formatter("%(message)s"))
consumer.addHandler(hdlr)
consumer = LoggerInfo()
self.add_consumer(Logger.INFO, consumer)
consumer = logging.getLogger('error')
consumer.setLevel(Logger.ERROR)
hdlr = logging.StreamHandler(sys.stderr)
hdlr.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
consumer.addHandler(hdlr)
consumer = LoggerError()
self.add_consumer(Logger.ERROR, consumer)
def debug(self, msg, *args, **keys):