using python binary from sys.executable

This commit is contained in:
Alan Hamlett 2013-07-23 12:09:58 -07:00
parent 4ab0f82346
commit 1e0b8ec55d

View File

@ -7,13 +7,15 @@ Website: https://www.wakati.me/
__version__ = '0.2.9' __version__ = '0.2.9'
import sublime
import sublime_plugin
import platform
import sys
import time import time
import uuid import uuid
from os.path import expanduser, dirname, realpath, isfile, join from os.path import expanduser, dirname, realpath, isfile, join
from subprocess import call, Popen from subprocess import call, Popen
import platform
import sublime
import sublime_plugin
# globals # globals
@ -52,11 +54,11 @@ def api(targetFile, timestamp, isWrite=False, endtime=0):
targetFile = LAST_FILE targetFile = LAST_FILE
if targetFile: if targetFile:
python_cmd = 'python' python_binary = sys.executable
if(platform.system() == 'Windows'): if platform.system() == 'Windows':
python_cmd = 'pythonw' python_binary = python_binary + 'w'
cmd = [python_cmd, API_CLIENT, cmd = [python_binary, API_CLIENT,
'--file', targetFile, '--file', targetFile,
'--time', str('%f' % timestamp), '--time', str('%f' % timestamp),
'--plugin', 'sublime-wakatime/%s' % __version__, '--plugin', 'sublime-wakatime/%s' % __version__,