Renklendirme için kendi yöntemimizi de yapabilirz biz, değil mi? ;)
This commit is contained in:
+3
-3
@@ -1,7 +1,7 @@
|
||||
# generic user interface
|
||||
|
||||
import sys
|
||||
from output import *
|
||||
from colors import colorize
|
||||
|
||||
# put the interface directly in the module
|
||||
# since the UI is _unique_
|
||||
@@ -19,11 +19,11 @@ def error(msg):
|
||||
# default UI implementation
|
||||
class CLI:
|
||||
def info(self, msg):
|
||||
sys.stdout.write(blue(msg))
|
||||
sys.stdout.write(colorize(msg, 'blue'))
|
||||
sys.stdout.flush()
|
||||
|
||||
def error(self,msg):
|
||||
sys.stdout.write(bold(red(msg)))
|
||||
sys.stdout.write(colorize(msg, 'red'))
|
||||
sys.stdout.flush()
|
||||
# default UI is CLI
|
||||
impl = CLI()
|
||||
|
||||
Reference in New Issue
Block a user