Mercurial > libervia-backend
comparison frontends/quick_frontend/quick_app.py @ 165:8a2053de6f8c
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
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 09 Aug 2010 21:36:31 +0800 |
parents | 2fa58703f1b7 |
children | 556c2bd7c344 |
comparison
equal
deleted
inserted
replaced
164:5d7a011d78ba | 165:8a2053de6f8c |
---|---|
19 along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 """ | 20 """ |
21 | 21 |
22 from logging import debug, info, error | 22 from logging import debug, info, error |
23 from tools.jid import JID | 23 from tools.jid import JID |
24 from sat_bridge_frontend.DBus import DBusBridgeFrontend | 24 from sat_bridge_frontend.DBus import DBusBridgeFrontend,BridgeExceptionNoService |
25 from optparse import OptionParser | 25 from optparse import OptionParser |
26 import pdb | 26 import pdb |
27 | 27 |
28 import gettext | 28 import gettext |
29 gettext.install('sat_frontend', "../i18n", unicode=True) | 29 gettext.install('sat_frontend', "../i18n", unicode=True) |
36 self.profiles = {} | 36 self.profiles = {} |
37 self.single_profile = single_profile | 37 self.single_profile = single_profile |
38 self.check_options() | 38 self.check_options() |
39 | 39 |
40 ## bridge ## | 40 ## bridge ## |
41 self.bridge=DBusBridgeFrontend() | 41 try: |
42 self.bridge=DBusBridgeFrontend() | |
43 except BridgeExceptionNoService: | |
44 print(_(u"Can't connect to SàT backend, are you sure it's launched ?")) | |
45 import sys | |
46 sys.exit(1) | |
42 self.bridge.register("connected", self.connected) | 47 self.bridge.register("connected", self.connected) |
43 self.bridge.register("disconnected", self.disconnected) | 48 self.bridge.register("disconnected", self.disconnected) |
44 self.bridge.register("newContact", self.newContact) | 49 self.bridge.register("newContact", self.newContact) |
45 self.bridge.register("newMessage", self.newMessage) | 50 self.bridge.register("newMessage", self.newMessage) |
46 self.bridge.register("presenceUpdate", self.presenceUpdate) | 51 self.bridge.register("presenceUpdate", self.presenceUpdate) |