don't print twice nbxmpp version error message. Fixes #7720

This commit is contained in:
Yann Leboulanger 2014-04-09 18:02:30 +02:00
parent 711a40e33c
commit 3657642f58
1 changed files with 11 additions and 4 deletions

View File

@ -68,19 +68,26 @@ if os.name == 'nt':
except ImportError:
pass
HAS_NBXMPP=True
MIN_NBXMPP_VER = "0.3.3"
try:
import nbxmpp
except ImportError:
HAS_NBXMPP=False
if not HAS_NBXMPP:
print('Gajim needs python-nbxmpp to run. Quiting...')
sys.exit()
try:
from distutils.version import LooseVersion as V
if V(nbxmpp.__version__) < V("0.3.3"):
print('Gajim needs python-nbxmpp > 0.3.3 to run. Quiting...')
sys.exit()
if V(nbxmpp.__version__) < V(MIN_NBXMPP_VER):
HAS_NBXMPP=False
except:
print('Gajim needs python-nbxmpp > 0.3.3 to run. Quiting...')
HAS_NBXMPP=False
if not HAS_NBXMPP:
print 'Gajim needs python-nbxmpp >= %s to run. Quiting...' % MIN_NBXMPP_VER
sys.exit()
#from common import demandimport