verbosely telling subprocess to not open a command window on Windows platforms
This commit is contained in:
parent
3bd9c31247
commit
bc8c1af287
1 changed files with 4 additions and 2 deletions
|
@ -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 a new issue