From 8a7c3a9f3c8164fdafde4d4b4cdc0f0ad56b9c15 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 22 Apr 2012 07:38:47 +0900 Subject: [PATCH] friendlify some error messages --- aqt/errors.py | 2 ++ aqt/importing.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/aqt/errors.py b/aqt/errors.py index b83c0f94b..64fe801b9 100644 --- a/aqt/errors.py +++ b/aqt/errors.py @@ -50,6 +50,8 @@ class ErrorHandler(QObject): return if "Pyaudio not" in error: return showWarning(_("Please install PyAudio")) + if "no default output" in error: + return showWarning(_("Please connect a microphone.")) stdText = _("""\ An error occurred. It may have been caused by a harmless bug,
or your deck may have a problem. diff --git a/aqt/importing.py b/aqt/importing.py index 0184ac2c2..0562da544 100644 --- a/aqt/importing.py +++ b/aqt/importing.py @@ -148,7 +148,10 @@ you can enter it here. Use \\t to represent tab."""), self.importer.run() except Exception, e: msg = _("Import failed.\n") - msg += unicode(traceback.format_exc(), "ascii", "replace") + if "1-character string" in unicode(e): + msg += unicode(e) + else: + msg += unicode(traceback.format_exc(), "ascii", "replace") showText(msg) return finally: