From 76c801f0997d7f0e1a82af83b7010e76e9eb5d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Thu, 16 Jun 2005 12:39:52 +0000 Subject: [PATCH] =?UTF-8?q?UI=20i=C3=A7ine=20error=20eklendi.=20build.py?= =?UTF-8?q?=20i=C3=A7indeki=20hatalar=20bunu=20kullan=C4=B1yor=20art=C4=B1?= =?UTF-8?q?k?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pisi/build.py | 4 ++-- src/pisi/ui.py | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) 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()