prevent using svn when Mac does not have xcode-tools installed
This commit is contained in:
parent
8ecba162aa
commit
bb71ff3106
2 changed files with 31 additions and 16 deletions
1
setup.py
1
setup.py
|
@ -38,7 +38,6 @@ setup(
|
||||||
'Intended Audience :: Developers',
|
'Intended Audience :: Developers',
|
||||||
'License :: OSI Approved :: BSD License',
|
'License :: OSI Approved :: BSD License',
|
||||||
'Natural Language :: English',
|
'Natural Language :: English',
|
||||||
'Programming Language :: Python',
|
|
||||||
'Topic :: Text Editors',
|
'Topic :: Text Editors',
|
||||||
'Programming Language :: Python',
|
'Programming Language :: Python',
|
||||||
'Programming Language :: Python :: 2',
|
'Programming Language :: Python :: 2',
|
||||||
|
|
|
@ -62,6 +62,7 @@ class Subversion(BaseProject):
|
||||||
|
|
||||||
def _get_info(self, path):
|
def _get_info(self, path):
|
||||||
info = OrderedDict()
|
info = OrderedDict()
|
||||||
|
if not self._is_mac() or self._has_xcode_tools():
|
||||||
stdout = None
|
stdout = None
|
||||||
try:
|
try:
|
||||||
os.environ['LANG'] = 'en_US'
|
os.environ['LANG'] = 'en_US'
|
||||||
|
@ -97,3 +98,18 @@ class Subversion(BaseProject):
|
||||||
return found
|
return found
|
||||||
return self._find_project_base(split_path[0], found)
|
return self._find_project_base(split_path[0], found)
|
||||||
|
|
||||||
|
def _is_mac(self):
|
||||||
|
return platform.system() == 'Darwin'
|
||||||
|
|
||||||
|
def _has_xcode_tools(self):
|
||||||
|
try:
|
||||||
|
with open(os.devnull, 'wb') as DEVNULL:
|
||||||
|
proc = Popen(['/usr/bin/xcode-select', '-p'], stdout=DEVNULL, stderr=DEVNULL)
|
||||||
|
proc.communicate()
|
||||||
|
retval = proc.wait()
|
||||||
|
if retval == 0:
|
||||||
|
return True
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue