UI içine error eklendi. build.py içindeki hatalar bunu kullanıyor artık
This commit is contained in:
+2
-2
@@ -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
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user