upgrade wakatime cli to v4.1.8

This commit is contained in:
Alan Hamlett
2015-09-29 03:11:25 -07:00
parent 16bbe21be9
commit 192a5c7aa7
28 changed files with 423 additions and 318 deletions

View File

@ -18,8 +18,8 @@ from .base import BaseProject
from ..compat import u, open
try:
from collections import OrderedDict
except ImportError:
from ..packages.ordereddict import OrderedDict
except ImportError: # pragma: nocover
from ..packages.ordereddict import OrderedDict # pragma: nocover
log = logging.getLogger('WakaTime')
@ -32,10 +32,14 @@ class Subversion(BaseProject):
return self._find_project_base(self.path)
def name(self):
return u(self.info['Repository Root'].split('/')[-1])
if 'Repository Root' not in self.info:
return None # pragma: nocover
return u(self.info['Repository Root'].split('/')[-1].split('\\')[-1])
def branch(self):
return u(self.info['URL'].split('/')[-1])
if 'URL' not in self.info:
return None # pragma: nocover
return u(self.info['URL'].split('/')[-1].split('\\')[-1])
def _find_binary(self):
if self.binary_location:
@ -69,8 +73,7 @@ class Subversion(BaseProject):
else:
if stdout:
for line in stdout.splitlines():
if isinstance(line, bytes):
line = bytes.decode(line)
line = u(line)
line = line.split(': ', 1)
if len(line) == 2:
info[line[0]] = line[1]
@ -78,7 +81,7 @@ class Subversion(BaseProject):
def _find_project_base(self, path, found=False):
if platform.system() == 'Windows':
return False
return False # pragma: nocover
path = os.path.realpath(path)
if os.path.isfile(path):
path = os.path.split(path)[0]