From 1b50a1a3702d0d3ebef971d5e9c980add5eddd37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Sun, 2 Oct 2005 20:40:22 +0000 Subject: [PATCH] =?UTF-8?q?-=20more=20exception=20errors.=20(talked=20with?= =?UTF-8?q?=20=C3=87a=C4=9Flar=20about=20it=20:)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/actionsapi/autotools.py | 24 ++++++++++++++++-------- pisi/actionsapi/libtools.py | 6 ++++-- pisi/actionsapi/pisitoolsfunctions.py | 12 ++++++++---- pisi/actionsapi/scons.py | 12 ++++++++---- 4 files changed, 36 insertions(+), 18 deletions(-) diff --git a/pisi/actionsapi/autotools.py b/pisi/actionsapi/autotools.py index 51d3171d..ddbb490a 100644 --- a/pisi/actionsapi/autotools.py +++ b/pisi/actionsapi/autotools.py @@ -24,22 +24,30 @@ from pisi.actionsapi.shelltools import can_access_file from pisi.actionsapi.libtools import gnuconfig_update class ConfigureError(pisi.actionsapi.Error): - def __init__(self, Exception): - ctx.ui.error(Exception) + def __init__(self, value): + pisi.actionsapi.Error.__init__(self, value) + self.value = value + ctx.ui.error(value) if can_access_file('config.log'): ctx.ui.error('\n!!! Please attach the config.log to your bug report:\n%s/config.log\n' % os.getcwd()) class MakeError(pisi.actionsapi.Error): - def __init__(self, Exception): - ctx.ui.error(Exception) + def __init__(self, value): + pisi.actionsapi.Error.__init__(self, value) + self.value = value + ctx.ui.error(value) class InstallError(pisi.actionsapi.Error): - def __init__(self, Exception): - ctx.ui.error(Exception) + def __init__(self, value): + pisi.actionsapi.Error.__init__(self, value) + self.value = value + ctx.ui.error(value) class RunTimeError(pisi.actionsapi.Error): - def __init__(self, Exception): - ctx.ui.error(Exception) + def __init__(self, value): + pisi.actionsapi.Error.__init__(self, value) + self.value = value + ctx.ui.error(value) def configure(parameters = ''): '''configure source with given parameters = "--with-nls --with-libusb --with-something-usefull"''' diff --git a/pisi/actionsapi/libtools.py b/pisi/actionsapi/libtools.py index a73f9d57..e5eb1174 100644 --- a/pisi/actionsapi/libtools.py +++ b/pisi/actionsapi/libtools.py @@ -22,8 +22,10 @@ from pisi.actionsapi.shelltools import * import pisi.actionsapi.get as get class RunTimeError(pisi.actionsapi.Error): - def __init__(self, Exception): - ctx.ui.error(Exception) + def __init__(self, value): + pisi.actionsapi.Error.__init__(self, value) + self.value = value + ctx.ui.error(value) def preplib(sourceDirectory = '/usr/lib'): sourceDirectory = get.installDIR() + sourceDirectory diff --git a/pisi/actionsapi/pisitoolsfunctions.py b/pisi/actionsapi/pisitoolsfunctions.py index 546b9bee..e13cb278 100644 --- a/pisi/actionsapi/pisitoolsfunctions.py +++ b/pisi/actionsapi/pisitoolsfunctions.py @@ -24,12 +24,16 @@ import pisi.actionsapi from pisi.actionsapi.shelltools import * class FileError(pisi.actionsapi.Error): - def __init__(self, Exception): - ctx.ui.error(Exception) + def __init__(self, value): + pisi.actionsapi.Error.__init__(self, value) + self.value = value + ctx.ui.error(value) class ArgumentError(pisi.actionsapi.Error): - def __init__(self, Exception): - ctx.ui.error(Exception) + def __init__(self, value): + pisi.actionsapi.Error.__init__(self, value) + self.value = value + ctx.ui.error(value) def executable_insinto(destinationDirectory, *sourceFiles): '''insert a executable file into destinationDirectory''' diff --git a/pisi/actionsapi/scons.py b/pisi/actionsapi/scons.py index 2dc67ee8..b40843e2 100644 --- a/pisi/actionsapi/scons.py +++ b/pisi/actionsapi/scons.py @@ -21,12 +21,16 @@ from pisi.actionsapi.shelltools import system class MakeError(pisi.actionsapi.Error): - def __init__(self, Exception): - ctx.ui.error(Exception) + def __init__(self, value): + pisi.actionsapi.Error.__init__(self, value) + self.value = value + ctx.ui.error(value) class InstallError(pisi.actionsapi.Error): - def __init__(self, Exception): - ctx.ui.error(Exception) + def __init__(self, value): + pisi.actionsapi.Error.__init__(self, value) + self.value = value + ctx.ui.error(value) def make(parameters = ''): if system("scons %s" % parameters):