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:
|
try:
|
||||||
self.actionScript = open(os.path.dirname(self.ctx.pspecfile ) + '/' + 'actions').read()
|
self.actionScript = open(os.path.dirname(self.ctx.pspecfile ) + '/' + 'actions').read()
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
print "Action Script: %s" % e
|
ui.error ("Action Script: %s\n" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
# FIXME: It's wrong to assume that unpacked archive
|
# FIXME: It's wrong to assume that unpacked archive
|
||||||
@@ -64,7 +64,7 @@ class PisiBuild:
|
|||||||
try:
|
try:
|
||||||
exec compile(self.actionScript , "error", "exec") in locals,globals
|
exec compile(self.actionScript , "error", "exec") in locals,globals
|
||||||
except SyntaxError, e:
|
except SyntaxError, e:
|
||||||
print "Error : %s" % e
|
ui.error ("Error : %s\n" % e)
|
||||||
return
|
return
|
||||||
|
|
||||||
self.configureSource(locals)
|
self.configureSource(locals)
|
||||||
|
|||||||
+7
-1
@@ -13,12 +13,18 @@ def register(_impl):
|
|||||||
def info(msg):
|
def info(msg):
|
||||||
impl.info(msg)
|
impl.info(msg)
|
||||||
|
|
||||||
|
def error(msg):
|
||||||
|
impl.error(msg)
|
||||||
|
|
||||||
# default UI implementation
|
# default UI implementation
|
||||||
class CLI:
|
class CLI:
|
||||||
def info(self, msg):
|
def info(self, msg):
|
||||||
sys.stdout.write(bold(red(msg)))
|
sys.stdout.write(blue(msg))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
def error(self,msg):
|
||||||
|
sys.stdout.write(bold(red(msg)))
|
||||||
|
sys.stdout.flush()
|
||||||
# default UI is CLI
|
# default UI is CLI
|
||||||
impl = CLI()
|
impl = CLI()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user