diff frontends/jp/jp @ 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 a216dfbb0d50
children 1438a1337732
line wrap: on
line diff
--- a/frontends/jp/jp	Mon Aug 09 19:09:43 2010 +0800
+++ b/frontends/jp/jp	Mon Aug 09 21:36:31 2010 +0800
@@ -55,7 +55,7 @@
 import pdb
 from tools.jid import JID
 import gobject
-from sat_bridge_frontend.DBus import DBusBridgeFrontend
+from sat_bridge_frontend.DBus import DBusBridgeFrontend,BridgeExceptionNoService
 import tarfile
 try:
     from progressbar import ProgressBar, Percentage, Bar, ETA, FileTransferSpeed
@@ -69,7 +69,12 @@
 
 class JP():
     def __init__(self):
-        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.transfert_id = None
 
     def check_options(self):