allow setting a proxy in sublime-settings file

This commit is contained in:
Alan Hamlett 2017-03-10 08:11:40 -08:00
parent d0b162bdd8
commit 02138220fd
2 changed files with 10 additions and 5 deletions

View file

@ -190,7 +190,6 @@ def create_config_file():
with open(configFile, 'w') as fh: with open(configFile, 'w') as fh:
fh.write("[settings]\n") fh.write("[settings]\n")
fh.write("debug = false\n") fh.write("debug = false\n")
fh.write("hidefilenames = false\n")
except IOError: except IOError:
pass pass
@ -483,6 +482,7 @@ class SendHeartbeatsThread(threading.Thread):
self.api_key = SETTINGS.get('api_key', '') self.api_key = SETTINGS.get('api_key', '')
self.ignore = SETTINGS.get('ignore', []) self.ignore = SETTINGS.get('ignore', [])
self.hidefilenames = SETTINGS.get('hidefilenames') self.hidefilenames = SETTINGS.get('hidefilenames')
self.proxy = SETTINGS.get('proxy')
self.heartbeat = heartbeat self.heartbeat = heartbeat
self.has_extra_heartbeats = False self.has_extra_heartbeats = False
@ -543,6 +543,8 @@ class SendHeartbeatsThread(threading.Thread):
cmd.append('--verbose') cmd.append('--verbose')
if self.hidefilenames: if self.hidefilenames:
cmd.append('--hidefilenames') cmd.append('--hidefilenames')
if self.proxy:
cmd.extend(['--proxy', self.proxy])
if self.has_extra_heartbeats: if self.has_extra_heartbeats:
cmd.append('--extra-heartbeats') cmd.append('--extra-heartbeats')
stdin = PIPE stdin = PIPE

View file

@ -7,13 +7,16 @@
// Set this in your User specific WakaTime.sublime-settings file. // Set this in your User specific WakaTime.sublime-settings file.
"api_key": "", "api_key": "",
// Debug mode. Set to true for verbose logging. Defaults to false.
"debug": false,
// Proxy with format https://user:pass@host:port or socks5://user:pass@host:port or domain\\user:pass.
"proxy": "",
// Ignore files; Files (including absolute paths) that match one of these // Ignore files; Files (including absolute paths) that match one of these
// POSIX regular expressions will not be logged. // POSIX regular expressions will not be logged.
"ignore": ["^/tmp/", "^/etc/", "^/var/", "COMMIT_EDITMSG$", "PULLREQ_EDITMSG$", "MERGE_MSG$", "TAG_EDITMSG$"], "ignore": ["^/tmp/", "^/etc/", "^/var/", "COMMIT_EDITMSG$", "PULLREQ_EDITMSG$", "MERGE_MSG$", "TAG_EDITMSG$"],
// Debug mode. Set to true for verbose logging. Defaults to false.
"debug": false,
// Status bar message. Set to false to hide status bar message. // Status bar message. Set to false to hide status bar message.
// Defaults to true. // Defaults to true.
"status_bar_message": true, "status_bar_message": true,
@ -21,6 +24,6 @@
// Status bar message format. // Status bar message format.
"status_bar_message_fmt": "WakaTime {status} %I:%M %p", "status_bar_message_fmt": "WakaTime {status} %I:%M %p",
// Hide filenames // Obfuscate file paths when sending to API. Your dashboard will no longer display coding activity per file.
"hidefilenames": false "hidefilenames": false
} }