From 484e3970d3c7582810dda581aa8ff0e6ef8f9120 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 1 Dec 2009 17:41:43 +0100 Subject: [PATCH] [dm] define an exception we use. Fixes #5457 --- src/common/dbus_support.py | 2 +- src/common/exceptions.py | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/common/dbus_support.py b/src/common/dbus_support.py index 24d4525ac..4762b474d 100644 --- a/src/common/dbus_support.py +++ b/src/common/dbus_support.py @@ -63,7 +63,7 @@ class SystemBus: raise exceptions.DbusNotSupported if not self.present(): - raise exceptions.SystemBusNotPresent + raise exceptions.SystemBusNotPresent return self.system_bus def bus(self): diff --git a/src/common/exceptions.py b/src/common/exceptions.py index ddd928752..090255768 100644 --- a/src/common/exceptions.py +++ b/src/common/exceptions.py @@ -75,7 +75,20 @@ class SessionBusNotPresent(Exception): Exception.__init__(self) def __str__(self): - return _('Session bus is not available.\nTry reading http://trac.gajim.org/wiki/GajimDBus') + return _('Session bus is not available.\nTry reading %(url)s') % \ + {'url': 'http://trac.gajim.org/wiki/GajimDBus'} + +class SystemBusNotPresent(Exception): + """ + This exception indicates that there is no session daemon + """ + + def __init__(self): + Exception.__init__(self) + + def __str__(self): + return _('System bus is not available.\nTry reading %(url)s') % \ + {'url': 'http://trac.gajim.org/wiki/GajimDBus'} class NegotiationError(Exception): """