upgrade wakatime-cli to v6.0.2

This commit is contained in:
Alan Hamlett 2016-05-16 16:10:32 +02:00
parent 2d30996a16
commit 5e0e9f913f
2 changed files with 32 additions and 16 deletions

View file

@ -1,7 +1,7 @@
__title__ = 'wakatime' __title__ = 'wakatime'
__description__ = 'Common interface to the WakaTime api.' __description__ = 'Common interface to the WakaTime api.'
__url__ = 'https://github.com/wakatime/wakatime' __url__ = 'https://github.com/wakatime/wakatime'
__version_info__ = ('6', '0', '1') __version_info__ = ('6', '0', '2')
__version__ = '.'.join(__version_info__) __version__ = '.'.join(__version_info__)
__author__ = 'Alan Hamlett' __author__ = 'Alan Hamlett'
__author_email__ = 'alan@wakatime.com' __author_email__ = 'alan@wakatime.com'

View file

@ -62,21 +62,22 @@ class Subversion(BaseProject):
def _get_info(self, path): def _get_info(self, path):
info = OrderedDict() info = OrderedDict()
stdout = None if not self._is_mac() or self._has_xcode_tools():
try: stdout = None
os.environ['LANG'] = 'en_US' try:
stdout, stderr = Popen([ os.environ['LANG'] = 'en_US'
self._find_binary(), 'info', os.path.realpath(path) stdout, stderr = Popen([
], stdout=PIPE, stderr=PIPE).communicate() self._find_binary(), 'info', os.path.realpath(path)
except OSError: ], stdout=PIPE, stderr=PIPE).communicate()
pass except OSError:
else: pass
if stdout: else:
for line in stdout.splitlines(): if stdout:
line = u(line) for line in stdout.splitlines():
line = line.split(': ', 1) line = u(line)
if len(line) == 2: line = line.split(': ', 1)
info[line[0]] = line[1] if len(line) == 2:
info[line[0]] = line[1]
return info return info
def _find_project_base(self, path, found=False): def _find_project_base(self, path, found=False):
@ -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