Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
164:5d7a011d78ba | 165:8a2053de6f8c |
---|---|
53 from os.path import abspath, basename, dirname | 53 from os.path import abspath, basename, dirname |
54 from optparse import OptionParser | 54 from optparse import OptionParser |
55 import pdb | 55 import pdb |
56 from tools.jid import JID | 56 from tools.jid import JID |
57 import gobject | 57 import gobject |
58 from sat_bridge_frontend.DBus import DBusBridgeFrontend | 58 from sat_bridge_frontend.DBus import DBusBridgeFrontend,BridgeExceptionNoService |
59 import tarfile | 59 import tarfile |
60 try: | 60 try: |
61 from progressbar import ProgressBar, Percentage, Bar, ETA, FileTransferSpeed | 61 from progressbar import ProgressBar, Percentage, Bar, ETA, FileTransferSpeed |
62 except ImportError, e: | 62 except ImportError, e: |
63 info (_('ProgressBar not available, please download it at http://pypi.python.org/pypi/progressbar')) | 63 info (_('ProgressBar not available, please download it at http://pypi.python.org/pypi/progressbar')) |
67 | 67 |
68 | 68 |
69 | 69 |
70 class JP(): | 70 class JP(): |
71 def __init__(self): | 71 def __init__(self): |
72 self.bridge=DBusBridgeFrontend() | 72 try: |
73 self.bridge=DBusBridgeFrontend() | |
74 except BridgeExceptionNoService: | |
75 print(_(u"Can't connect to SàT backend, are you sure it's launched ?")) | |
76 import sys | |
77 sys.exit(1) | |
73 self.transfert_id = None | 78 self.transfert_id = None |
74 | 79 |
75 def check_options(self): | 80 def check_options(self): |
76 """Check command line options""" | 81 """Check command line options""" |
77 usage=_(""" | 82 usage=_(""" |