avoid showing the exception, print and exit when checkbin() fail. closes #80

This commit is contained in:
Mathieu Virbel 2014-04-21 13:37:50 +02:00
parent fc2f00b8b4
commit 2a9f4aa4d8
2 changed files with 6 additions and 5 deletions

View file

@ -230,7 +230,8 @@ class Buildozer(object):
if exists(rfn): if exists(rfn):
self.debug(' -> found at {0}'.format(rfn)) self.debug(' -> found at {0}'.format(rfn))
return rfn return rfn
raise Exception(msg + 'not found') self.error('{} not found, please install it.'.format(msg))
exit(1)
def cmd(self, command, **kwargs): def cmd(self, command, **kwargs):
# prepare the environ, based on the system + our own env # prepare the environ, based on the system + our own env

View file

@ -125,10 +125,10 @@ class TargetAndroid(Target):
path.append(os.environ['PATH']) path.append(os.environ['PATH'])
self.buildozer.environ['PATH'] = ':'.join(path) self.buildozer.environ['PATH'] = ':'.join(path)
checkbin = self.buildozer.checkbin checkbin = self.buildozer.checkbin
checkbin('Git git', 'git') checkbin('Git (git)', 'git')
checkbin('Cython cython', 'cython') checkbin('Cython (cython)', 'cython')
checkbin('Java compiler', self.javac_cmd) checkbin('Java compiler (javac)', self.javac_cmd)
checkbin('Java keytool', self.keytool_cmd) checkbin('Java keytool (keytool)', self.keytool_cmd)
def check_configuration_tokens(self): def check_configuration_tokens(self):
errors = [] errors = []