From c72586ddbe61f6bd216dbce4a849c85656fae3e6 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 11 Mar 2014 11:57:51 +0800 Subject: [PATCH] ask to set ANT_ROOT, and add more redeable information --- setup.py | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/setup.py b/setup.py index 45d275b6b6..11f90fe908 100755 --- a/setup.py +++ b/setup.py @@ -277,26 +277,6 @@ class SetEnvVar(object): else: return False - def _is_ant_exists(self): - - try: - os.environ[ANT_ROOT] - return True - except Exception: - pass - - ant_found = False - commands = ['ant', '-version'] - child = subprocess.Popen(commands, stdout=subprocess.PIPE) - for line in child.stdout: - if 'Ant' in line: - ant_found = True - break - - child.wait() - - return ant_found - def _is_ant_root_valid(self, ant_root): ant_path = '' @@ -391,7 +371,7 @@ class SetEnvVar(object): print "" print '-> Looking for ANT_ROOT envrironment variable...', ant_root_added = False - ant_found = self._is_ant_exists() + ant_found = self._find_environment_variable(ANT_ROOT) if not ant_root and not ant_found: print 'NOT FOUND' @@ -427,7 +407,12 @@ class SetEnvVar(object): if ant_root_added: print '\tANT_ROOT was added into %s' % target else: - print '\nCOCOS_CONSOLE_ROOT was already added. Edit "%s" for manual changes' % target + print '\nCOCOS_CONSOLE_ROOT was already added. Edit "%s" for manual changes' % target + + if self._isWindows(): + print '\nPlease restart the terminal to make added system variables take effect' + else: + print '\nPlease execute command: "source %s" to make added system variables take effect' % target if __name__ == '__main__': parser = OptionParser()