Frontends: management of unlaunched SàT Backend (information message and exit)

DBus Bridge Frontend: added an exception to manage unlaunched SàT Backend (BridgeExceptionNoService)
Quick App, jp: a message is print when the previous exception is launched
This commit is contained in:
Goffi 2010-08-09 21:36:31 +08:00
commit d2ca8812df

View file

@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
from logging import debug, info, error
from tools.jid import JID
from sat_bridge_frontend.DBus import DBusBridgeFrontend
from sat_bridge_frontend.DBus import DBusBridgeFrontend,BridgeExceptionNoService
from optparse import OptionParser
import pdb
@ -38,7 +38,12 @@ class QuickApp():
self.check_options()
## bridge ##
self.bridge=DBusBridgeFrontend()
try:
self.bridge=DBusBridgeFrontend()
except BridgeExceptionNoService:
print(_(u"Can't connect to SàT backend, are you sure it's launched ?"))
import sys
sys.exit(1)
self.bridge.register("connected", self.connected)
self.bridge.register("disconnected", self.disconnected)
self.bridge.register("newContact", self.newContact)