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

@ -55,7 +55,7 @@ from optparse import OptionParser
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 @@ except ImportError, e:
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):