never use subprocess, even if no SSL support
This commit is contained in:
parent
45662cc96a
commit
11a5b58c9d
1 changed files with 8 additions and 9 deletions
17
WakaTime.py
17
WakaTime.py
|
@ -30,19 +30,18 @@ SETTINGS = {}
|
||||||
LAST_ACTION = 0
|
LAST_ACTION = 0
|
||||||
LAST_FILE = None
|
LAST_FILE = None
|
||||||
BUSY = False
|
BUSY = False
|
||||||
HAS_SSL = False
|
|
||||||
|
|
||||||
# check if we have SSL support
|
# check if we have SSL support
|
||||||
try:
|
try:
|
||||||
import ssl
|
import ssl
|
||||||
HAS_SSL = True
|
HAS_SSL = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from subprocess import Popen
|
#from subprocess import Popen
|
||||||
|
pass
|
||||||
|
|
||||||
# import wakatime package
|
# import wakatime package
|
||||||
if HAS_SSL:
|
sys.path.insert(0, join(PLUGIN_DIR, 'packages', 'wakatime'))
|
||||||
sys.path.insert(0, join(PLUGIN_DIR, 'packages', 'wakatime'))
|
import wakatime
|
||||||
import wakatime
|
|
||||||
|
|
||||||
|
|
||||||
def setup_settings_file():
|
def setup_settings_file():
|
||||||
|
@ -156,15 +155,15 @@ class SendActionThread(threading.Thread):
|
||||||
if SETTINGS.get('debug'):
|
if SETTINGS.get('debug'):
|
||||||
cmd.append('--verbose')
|
cmd.append('--verbose')
|
||||||
print(cmd)
|
print(cmd)
|
||||||
if HAS_SSL:
|
#if HAS_SSL:
|
||||||
wakatime.main(cmd)
|
wakatime.main(cmd)
|
||||||
else:
|
"""else:
|
||||||
cmd.insert(0, python_binary())
|
cmd.insert(0, python_binary())
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
Popen(cmd, shell=False)
|
Popen(cmd, shell=False)
|
||||||
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)"""
|
||||||
|
|
||||||
|
|
||||||
def plugin_loaded():
|
def plugin_loaded():
|
||||||
|
|
Loading…
Reference in a new issue