Skip to content

Commit

Permalink
allow setting a proxy in sublime-settings file
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhamlett committed Mar 10, 2017
1 parent d0b162b commit 0213822
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion WakaTime.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ def create_config_file():
with open(configFile, 'w') as fh:
fh.write("[settings]\n")
fh.write("debug = false\n")
fh.write("hidefilenames = false\n")
except IOError:
pass

Expand Down Expand Up @@ -483,6 +482,7 @@ def __init__(self, heartbeat):
self.api_key = SETTINGS.get('api_key', '')
self.ignore = SETTINGS.get('ignore', [])
self.hidefilenames = SETTINGS.get('hidefilenames')
self.proxy = SETTINGS.get('proxy')

self.heartbeat = heartbeat
self.has_extra_heartbeats = False
Expand Down Expand Up @@ -543,6 +543,8 @@ def send_heartbeats(self):
cmd.append('--verbose')
if self.hidefilenames:
cmd.append('--hidefilenames')
if self.proxy:
cmd.extend(['--proxy', self.proxy])
if self.has_extra_heartbeats:
cmd.append('--extra-heartbeats')
stdin = PIPE
Expand Down
11 changes: 7 additions & 4 deletions WakaTime.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@
// Set this in your User specific WakaTime.sublime-settings file.
"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
// POSIX regular expressions will not be logged.
"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.
// Defaults to true.
"status_bar_message": true,

// Status bar message format.
"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
}

0 comments on commit 0213822

Please sign in to comment.