mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
using Popen as backup when ST2 doesn't have SSL support
This commit is contained in:
parent
8d39fccabb
commit
6e0b332885
19
WakaTime.py
19
WakaTime.py
@ -30,18 +30,19 @@ SETTINGS = {}
|
||||
LAST_ACTION = 0
|
||||
LAST_FILE = None
|
||||
BUSY = False
|
||||
HAS_SSL = False
|
||||
|
||||
# check if we have SSL support
|
||||
try:
|
||||
import ssl
|
||||
HAS_SSL = True
|
||||
except ImportError:
|
||||
#from subprocess import Popen
|
||||
pass
|
||||
|
||||
# import wakatime package
|
||||
sys.path.insert(0, join(PLUGIN_DIR, 'packages', 'wakatime'))
|
||||
import wakatime
|
||||
# import wakatime package
|
||||
sys.path.insert(0, join(PLUGIN_DIR, 'packages', 'wakatime'))
|
||||
import wakatime
|
||||
|
||||
except ImportError:
|
||||
from subprocess import Popen
|
||||
|
||||
|
||||
def setup_settings_file():
|
||||
@ -155,15 +156,15 @@ class SendActionThread(threading.Thread):
|
||||
if SETTINGS.get('debug'):
|
||||
cmd.append('--verbose')
|
||||
print(cmd)
|
||||
#if HAS_SSL:
|
||||
if HAS_SSL:
|
||||
wakatime.main(cmd)
|
||||
"""else:
|
||||
else:
|
||||
cmd.insert(0, python_binary())
|
||||
if platform.system() == 'Windows':
|
||||
Popen(cmd, shell=False)
|
||||
else:
|
||||
with open(join(expanduser('~'), '.wakatime.log'), 'a') as stderr:
|
||||
Popen(cmd, stderr=stderr)"""
|
||||
Popen(cmd, stderr=stderr)
|
||||
|
||||
|
||||
def plugin_loaded():
|
||||
|
Loading…
Reference in New Issue
Block a user