mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
verbosely telling subprocess to not open a command window on Windows platforms
This commit is contained in:
parent
3bd9c31247
commit
bc8c1af287
@ -15,7 +15,7 @@ import platform
|
|||||||
import time
|
import time
|
||||||
import uuid
|
import uuid
|
||||||
from os.path import expanduser, dirname, realpath, isfile, join, exists
|
from os.path import expanduser, dirname, realpath, isfile, join, exists
|
||||||
from subprocess import call, Popen
|
from subprocess import call, Popen, STARTUPINFO, STARTF_USESHOWWINDOW
|
||||||
|
|
||||||
|
|
||||||
# globals
|
# globals
|
||||||
@ -79,7 +79,9 @@ def api(targetFile, timestamp, isWrite=False, endtime=0):
|
|||||||
cmd.extend(['--endtime', str('%f' % endtime)])
|
cmd.extend(['--endtime', str('%f' % endtime)])
|
||||||
#print(cmd)
|
#print(cmd)
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
Popen(cmd)
|
startupinfo = STARTUPINFO()
|
||||||
|
startupinfo.dwFlags |= STARTF_USESHOWWINDOW
|
||||||
|
Popen(cmd, startupinfo=startupinfo)
|
||||||
else:
|
else:
|
||||||
with open(join(expanduser('~'), '.wakatime.log'), 'a') as stderr:
|
with open(join(expanduser('~'), '.wakatime.log'), 'a') as stderr:
|
||||||
Popen(cmd, stderr=stderr)
|
Popen(cmd, stderr=stderr)
|
||||||
|
Loading…
Reference in New Issue
Block a user