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
|
# 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()
|
||||||
|
|||||||
Reference in New Issue
Block a user