Renklendirme için kendi yöntemimizi de yapabilirz biz, değil mi? ;)

This commit is contained in:
Barış Metin
2005-06-16 17:57:49 +00:00
parent 467268f5e3
commit 9711df9de5
+3 -3
View File
@@ -1,7 +1,7 @@
# generic user interface # generic user interface
import sys import sys
from output import * from colors import colorize
# put the interface directly in the module # put the interface directly in the module
# since the UI is _unique_ # since the UI is _unique_
@@ -19,11 +19,11 @@ def error(msg):
# default UI implementation # default UI implementation
class CLI: class CLI:
def info(self, msg): def info(self, msg):
sys.stdout.write(blue(msg)) sys.stdout.write(colorize(msg, 'blue'))
sys.stdout.flush() sys.stdout.flush()
def error(self,msg): def error(self,msg):
sys.stdout.write(bold(red(msg))) sys.stdout.write(colorize(msg, 'red'))
sys.stdout.flush() sys.stdout.flush()
# default UI is CLI # default UI is CLI
impl = CLI() impl = CLI()