mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
upgrade wakatime cli to v4.1.8
This commit is contained in:
@ -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]
|
||||
|
Reference in New Issue
Block a user