diff --git a/frontends/src/jp/cmd_info.py b/frontends/src/jp/cmd_info.py index becdd028..716c8477 100644 --- a/frontends/src/jp/cmd_info.py +++ b/frontends/src/jp/cmd_info.py @@ -41,7 +41,7 @@ class Disco(base.CommandBase): self.host.bridge.discoInfos(jid, profile_key=self.host.profile, callback=lambda infos: self.gotInfos(infos, jid), errback=self.error) def error(self, failure): - print (_("Error while doing discovery")) + print (_("Error while doing discovery [%s]") % failure) self.host.quit(1) def gotInfos(self, infos, jid): diff --git a/frontends/src/primitivus/chat.py b/frontends/src/primitivus/chat.py index ee711151..10afe13e 100644 --- a/frontends/src/primitivus/chat.py +++ b/frontends/src/primitivus/chat.py @@ -354,7 +354,7 @@ class Chat(urwid.WidgetWrap, QuickChat): def gotUI(xmlui): self.host.addWindow(XMLUI(self.host, xmlui)) def configureError(failure): - self.host.showPopUp(sat_widgets.Alert(_("Error"), unicode(failure), ok_cb=self.host.removePopUp)) + self.host.showPopUp(sat_widgets.Alert(failure.fullname, failure.message, ok_cb=self.host.removePopUp)) self.host.bridge.configureRoom(self.id, self.host.profile, callback=gotUI, errback=configureError) def onSendFileRequest(self, menu): diff --git a/frontends/src/primitivus/primitivus b/frontends/src/primitivus/primitivus index c72732a0..b8ad7fff 100755 --- a/frontends/src/primitivus/primitivus +++ b/frontends/src/primitivus/primitivus @@ -102,7 +102,7 @@ class EditBar(sat_widgets.ModalEdit): self.app.sendMessage(contact, editBar.get_edit_text(), mess_type = "groupchat" if chat.type == 'group' else "chat", - errback=lambda failure: self.app.notify(_("Error while sending message (%s)") % unicode(failure)), + errback=lambda failure: self.app.notify(_("Error while sending message (%s)") % failure), profile_key=self.app.profile ) editBar.set_edit_text('') @@ -468,7 +468,7 @@ class PrimitivusApp(QuickApp, InputHistory): self.showPopUp(sat_widgets.Alert(_("Error"), _(u"Unmanaged action result"), ok_cb=self.removePopUp)) def action_eb(failure): - self.showPopUp(sat_widgets.Alert(_("Error"), unicode(failure), ok_cb=self.removePopUp)) + self.showPopUp(sat_widgets.Alert(failure.fullname, failure.message, ok_cb=self.removePopUp)) self.bridge.launchAction(callback_id, data, profile_key, callback=action_cb, errback=action_eb) @@ -571,7 +571,7 @@ class PrimitivusApp(QuickApp, InputHistory): self.addWindow(XMLUI(self, xml_data=params)) def failure(error): - self.showPopUp(sat_widgets.Alert(_("Error"), _("Can't get parameters"), ok_cb=self.removePopUp)) + self.showPopUp(sat_widgets.Alert(_("Error"), _("Can't get parameters (%s)") % error, ok_cb=self.removePopUp)) self.bridge.getParamsUI(app=C.APP_NAME, profile_key=self.profile, callback=success, errback=failure) def onExitRequest(self, menu): diff --git a/frontends/src/primitivus/profile_manager.py b/frontends/src/primitivus/profile_manager.py index 419e0552..8759ddba 100644 --- a/frontends/src/primitivus/profile_manager.py +++ b/frontends/src/primitivus/profile_manager.py @@ -83,14 +83,12 @@ class ProfileManager(urwid.WidgetWrap): def _profileCreationFailure(self, reason): self.host.removePopUp() - if reason=="ConflictError": - message=_("A profile with this name already exists") - elif reason=="CancelError": - message=_("Profile creation cancelled by backend") - elif reason=="DATABASE": # FIXME: doesn't seem to exist ! - message=_("Database error") + if reason == "ConflictError": + message = _("A profile with this name already exists") + elif reason == "CancelError": + message = _("Profile creation cancelled by backend") else: - message=_("Unknown reason (%s)") % reason + message = _("Unknown reason (%s)") % reason popup = Alert(_("Can't create profile"), message, ok_cb=self.host.removePopUp) self.host.showPopUp(popup) diff --git a/frontends/src/quick_frontend/quick_app.py b/frontends/src/quick_frontend/quick_app.py index 75a84838..614bab78 100644 --- a/frontends/src/quick_frontend/quick_app.py +++ b/frontends/src/quick_frontend/quick_app.py @@ -287,7 +287,7 @@ class QuickApp(object): if callback is None: callback = lambda: None if errback is None: - errback = lambda failure: self.showDialog(unicode(failure), _(u"sendMessage Error"), "error") + errback = lambda failure: self.showDialog(failure.fullname, failure.message, "error") self.bridge.sendMessage(to_jid, message, subject, mess_type, extra, profile_key, callback=callback, errback=errback) def newAlert(self, msg, title, alert_type, profile): diff --git a/frontends/src/wix/main_window.py b/frontends/src/wix/main_window.py index 6b30dce8..42db1100 100644 --- a/frontends/src/wix/main_window.py +++ b/frontends/src/wix/main_window.py @@ -256,8 +256,8 @@ class MainWindow(wx.Frame, QuickApp): dlg.ShowModal() dlg.Destroy() def action_eb(failure): - dlg = wx.MessageDialog(self, unicode(failure), - _('Error'), + dlg = wx.MessageDialog(self, failure.message, + failure.fullname, wx.OK | wx.ICON_ERROR ) dlg.ShowModal() @@ -411,8 +411,8 @@ class MainWindow(wx.Frame, QuickApp): XMLUI(self, xml_data=params, title=_("Configuration")) def failure(error): - dlg = wx.MessageDialog(self, unicode(error), - _('Error'), + dlg = wx.MessageDialog(self, error.message, + error.fullname, wx.OK | wx.ICON_ERROR ) dlg.ShowModal() diff --git a/src/core/sat_main.py b/src/core/sat_main.py index ee1f9244..84480dda 100644 --- a/src/core/sat_main.py +++ b/src/core/sat_main.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from sat.core.i18n import _, languageSwitch +from sat.core.i18n import _, D_, languageSwitch from twisted.application import service from twisted.internet import defer from twisted.words.protocols.jabber import jid @@ -298,7 +298,7 @@ class SAT(service.Service): def check_result(result): if not result: log.warning(_('Authentication failure of profile %s') % profile) - raise exceptions.PasswordError(_("The provided profile password doesn't match.")) + raise exceptions.PasswordError(D_("The provided profile password doesn't match.")) if not session_data: # avoid to create two profile sessions when password if specified return self.memory.newAuthSession(password, profile) diff --git a/src/stdui/ui_profile_manager.py b/src/stdui/ui_profile_manager.py index 2bf2a325..407adb5f 100644 --- a/src/stdui/ui_profile_manager.py +++ b/src/stdui/ui_profile_manager.py @@ -80,7 +80,7 @@ class ProfileManager(object): def getParamError(self): _dialog = xml_tools.XMLUI('popup', title=D_('Error')) - _dialog.addText(_("Can't get profile parameter.")) + _dialog.addText(D_("Can't get profile parameter.")) return {'xmlui': _dialog.toXml()} @defer.inlineCallbacks