From 2a9f4aa4d822ddaf75043d0084ba894803852f01 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Mon, 21 Apr 2014 13:37:50 +0200 Subject: [PATCH] avoid showing the exception, print and exit when checkbin() fail. closes #80 --- buildozer/__init__.py | 3 ++- buildozer/targets/android.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/buildozer/__init__.py b/buildozer/__init__.py index 391a6d7..3c74903 100644 --- a/buildozer/__init__.py +++ b/buildozer/__init__.py @@ -230,7 +230,8 @@ class Buildozer(object): if exists(rfn): self.debug(' -> found at {0}'.format(rfn)) return rfn - raise Exception(msg + 'not found') + self.error('{} not found, please install it.'.format(msg)) + exit(1) def cmd(self, command, **kwargs): # prepare the environ, based on the system + our own env diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index f3609d8..af9a860 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -125,10 +125,10 @@ class TargetAndroid(Target): path.append(os.environ['PATH']) self.buildozer.environ['PATH'] = ':'.join(path) checkbin = self.buildozer.checkbin - checkbin('Git git', 'git') - checkbin('Cython cython', 'cython') - checkbin('Java compiler', self.javac_cmd) - checkbin('Java keytool', self.keytool_cmd) + checkbin('Git (git)', 'git') + checkbin('Cython (cython)', 'cython') + checkbin('Java compiler (javac)', self.javac_cmd) + checkbin('Java keytool (keytool)', self.keytool_cmd) def check_configuration_tokens(self): errors = []