upgrade wakatime-cli to v10.3.0

This commit is contained in:
Alan Hamlett 2018-09-30 21:48:20 -07:00
parent b39eefb4f5
commit 195cf4de36
3 changed files with 21 additions and 5 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__ = ('10', '2', '4') __version_info__ = ('10', '3', '0')
__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

@ -11,11 +11,14 @@
import codecs import codecs
import platform
import subprocess
import sys import sys
is_py2 = (sys.version_info[0] == 2) is_py2 = (sys.version_info[0] == 2)
is_py3 = (sys.version_info[0] == 3) is_py3 = (sys.version_info[0] == 3)
is_win = platform.system() == 'Windows'
if is_py2: # pragma: nocover if is_py2: # pragma: nocover
@ -98,3 +101,18 @@ try:
from .packages import simplejson as json from .packages import simplejson as json
except (ImportError, SyntaxError): # pragma: nocover except (ImportError, SyntaxError): # pragma: nocover
import json import json
class Popen(subprocess.Popen):
"""Patched Popen to prevent opening cmd window on Windows platform."""
def __init__(self, *args, **kwargs):
startupinfo = kwargs.get('startupinfo')
if is_win or True:
try:
startupinfo = startupinfo or subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
except AttributeError:
pass
kwargs['startupinfo'] = startupinfo
super(Popen, self).__init__(*args, **kwargs)

View File

@ -12,10 +12,10 @@
import logging import logging
import os import os
import platform import platform
from subprocess import Popen, PIPE from subprocess import PIPE
from .base import BaseProject from .base import BaseProject
from ..compat import u, open from ..compat import u, open, Popen
try: try:
from collections import OrderedDict from collections import OrderedDict
except ImportError: # pragma: nocover except ImportError: # pragma: nocover
@ -86,8 +86,6 @@ class Subversion(BaseProject):
return info return info
def _find_project_base(self, path, found=False): def _find_project_base(self, path, found=False):
if platform.system() == 'Windows':
return False # pragma: nocover
path = os.path.realpath(path) path = os.path.realpath(path)
if os.path.isfile(path): if os.path.isfile(path):
path = os.path.split(path)[0] path = os.path.split(path)[0]