def __init__(self, parent, ex, title="Error", **kw): kw = KwStruct(kw, bitmap="error") text = kw.get("text", "") if not text.endswith("\n"): text = text + "\n" text = text + "\n" if isinstance(ex, EnvironmentError) and ex.filename is not None: t = "[Errno %s] %s:\n%s" % (ex.errno, ex.strerror, repr(ex.filename)) else: t = str(ex) kw.text = text + unicode(t, errors='replace') MfxMessageDialog.__init__(self, parent, title, **kw.getKw())
def __init__(self, parent, ex, title="Error", **kw): kw = KwStruct(kw, bitmap="error") text = str(kw.get("text", "")) if text and text[-1] != "\n": text = text + "\n" text = text + "\n" if isinstance(ex, EnvironmentError) and ex.filename is not None: t = '[Errno %s] %s:\n%s' % (ex.errno, ex.strerror, repr(ex.filename)) else: t = str(ex) kw.text = text + t MfxDialog.__init__(self, parent, title, **kw.__dict__)
def __init__(self, parent, ex, title="Error", **kw): kw = KwStruct(kw, bitmap="error") text = kw.get("text", "") if not text.endswith("\n"): text = text + "\n" text = text + "\n" if isinstance(ex, EnvironmentError) and ex.filename is not None: t = "[Errno %s] %s:\n%s" % \ (ex.errno, ex.strerror, repr(ex.filename)) else: t = str(ex) kw.text = text + unicode(t, errors='replace') MfxMessageDialog.__init__(self, parent, title, **kw.getKw())