UI içine error eklendi. build.py içindeki hatalar bunu kullanıyor artık

This commit is contained in:
S.Çağlar Onur
2005-06-16 12:39:52 +00:00
parent 61a54e0933
commit 76c801f099
2 changed files with 9 additions and 3 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ class PisiBuild:
try:
self.actionScript = open(os.path.dirname(self.ctx.pspecfile ) + '/' + 'actions').read()
except IOError, e:
print "Action Script: %s" % e
ui.error ("Action Script: %s\n" % e)
return
# FIXME: It's wrong to assume that unpacked archive
@@ -64,7 +64,7 @@ class PisiBuild:
try:
exec compile(self.actionScript , "error", "exec") in locals,globals
except SyntaxError, e:
print "Error : %s" % e
ui.error ("Error : %s\n" % e)
return
self.configureSource(locals)
+7 -1
View File
@@ -13,12 +13,18 @@ def register(_impl):
def info(msg):
impl.info(msg)
def error(msg):
impl.error(msg)
# default UI implementation
class CLI:
def info(self, msg):
sys.stdout.write(bold(red(msg)))
sys.stdout.write(blue(msg))
sys.stdout.flush()
def error(self,msg):
sys.stdout.write(bold(red(msg)))
sys.stdout.flush()
# default UI is CLI
impl = CLI()