diff --git a/src/pisi/build.py b/src/pisi/build.py index 733a96c8..28fa8bee 100644 --- a/src/pisi/build.py +++ b/src/pisi/build.py @@ -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) diff --git a/src/pisi/ui.py b/src/pisi/ui.py index 168bf51a..7736644f 100644 --- a/src/pisi/ui.py +++ b/src/pisi/ui.py @@ -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()