diff --git a/WakaTime.py b/WakaTime.py index b2c2ab6..7c9d3ab 100644 --- a/WakaTime.py +++ b/WakaTime.py @@ -465,6 +465,7 @@ class SendHeartbeatsThread(threading.Thread): self.include = SETTINGS.get('include', []) self.hidefilenames = SETTINGS.get('hidefilenames') self.proxy = SETTINGS.get('proxy') + self.python_binary = SETTINGS.get('python_binary') self.heartbeat = heartbeat self.has_extra_heartbeats = False @@ -501,11 +502,14 @@ class SendHeartbeatsThread(threading.Thread): return heartbeat def send_heartbeats(self): - if python_binary(): + python = self.python_binary + if not python or not python.strip(): + python = python_binary() + if python: heartbeat = self.build_heartbeat(**self.heartbeat) ua = 'sublime/%d sublime-wakatime/%s' % (ST_VERSION, __version__) cmd = [ - python_binary(), + python, API_CLIENT, '--entity', heartbeat['entity'], '--time', str('%f' % heartbeat['timestamp']), diff --git a/WakaTime.sublime-settings b/WakaTime.sublime-settings index 07e1934..e461b5f 100644 --- a/WakaTime.sublime-settings +++ b/WakaTime.sublime-settings @@ -29,5 +29,8 @@ "status_bar_message_fmt": "WakaTime {status} %I:%M %p", // Obfuscate file paths when sending to API. Your dashboard will no longer display coding activity per file. - "hidefilenames": false + "hidefilenames": false, + + // Python binary location. Uses python from your PATH by default. + "python_binary": "" }