upgrade wakatime package to v2.0.7

This commit is contained in:
Alan Hamlett 2014-08-27 03:34:31 -07:00
parent 10657d8f85
commit 9043b363eb
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