upgrade wakatime-cli to v2.0.7 to fix #25

This commit is contained in:
Alan Hamlett 2014-08-27 03:31:14 -07:00
parent 986e592d1e
commit 6b6f60d8e8
3 changed files with 33 additions and 2 deletions

View file

@ -3,6 +3,18 @@ History
-------
2.0.7 (2014-08-27)
++++++++++++++++++
- find svn binary location from common install directories
2.0.6 (2014-08-07)
++++++++++++++++++
- encode json data as str when passing to urllib
2.0.5 (2014-07-25)
++++++++++++++++++

View file

@ -13,7 +13,7 @@
from __future__ import print_function
__title__ = 'wakatime'
__version__ = '2.0.6'
__version__ = '2.0.7'
__author__ = 'Alan Hamlett'
__license__ = 'BSD'
__copyright__ = 'Copyright 2014 Alan Hamlett'

View file

@ -32,6 +32,7 @@ except NameError:
class Subversion(BaseProject):
binary_location = None
def process(self):
return self._find_project_base(self.path)
@ -44,13 +45,31 @@ class Subversion(BaseProject):
unicode(os.path.basename(self.base))
return None
def _find_binary(self):
if self.binary_location:
return self.binary_location
locations = [
'svn',
'/usr/bin/svn',
'/usr/local/bin/svn',
]
for location in locations:
try:
Popen([location, '--version'])
self.binary_location = location
return location
except:
pass
self.binary_location = 'svn'
return 'svn'
def _get_info(self, path):
info = OrderedDict()
stdout = None
try:
os.environ['LANG'] = 'en_US'
stdout, stderr = Popen([
'svn', 'info', os.path.realpath(path)
self._find_binary(), 'info', os.path.realpath(path)
], stdout=PIPE, stderr=PIPE).communicate()
except OSError:
pass