upgrade wakatime-cli to v10.3.0
This commit is contained in:
parent
17e5d1b211
commit
42f83e3df5
3 changed files with 21 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
__title__ = 'wakatime'
|
||||
__description__ = 'Common interface to the WakaTime api.'
|
||||
__url__ = 'https://github.com/wakatime/wakatime'
|
||||
__version_info__ = ('10', '2', '4')
|
||||
__version_info__ = ('10', '3', '0')
|
||||
__version__ = '.'.join(__version_info__)
|
||||
__author__ = 'Alan Hamlett'
|
||||
__author_email__ = 'alan@wakatime.com'
|
||||
|
|
|
@ -11,11 +11,14 @@
|
|||
|
||||
|
||||
import codecs
|
||||
import platform
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
is_py2 = (sys.version_info[0] == 2)
|
||||
is_py3 = (sys.version_info[0] == 3)
|
||||
is_win = platform.system() == 'Windows'
|
||||
|
||||
|
||||
if is_py2: # pragma: nocover
|
||||
|
@ -98,3 +101,18 @@ try:
|
|||
from .packages import simplejson as json
|
||||
except (ImportError, SyntaxError): # pragma: nocover
|
||||
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)
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
import logging
|
||||
import os
|
||||
import platform
|
||||
from subprocess import Popen, PIPE
|
||||
from subprocess import PIPE
|
||||
|
||||
from .base import BaseProject
|
||||
from ..compat import u, open
|
||||
from ..compat import u, open, Popen
|
||||
try:
|
||||
from collections import OrderedDict
|
||||
except ImportError: # pragma: nocover
|
||||
|
@ -86,8 +86,6 @@ class Subversion(BaseProject):
|
|||
return info
|
||||
|
||||
def _find_project_base(self, path, found=False):
|
||||
if platform.system() == 'Windows':
|
||||
return False # pragma: nocover
|
||||
path = os.path.realpath(path)
|
||||
if os.path.isfile(path):
|
||||
path = os.path.split(path)[0]
|
||||
|
|
Loading…
Reference in a new issue