From f4e53cd682e31d7ae4c366234c1530341b8f7cd3 Mon Sep 17 00:00:00 2001 From: Krishna Glick Date: Thu, 14 Sep 2017 10:39:28 -0400 Subject: [PATCH] Added 'include' functionality --- AUTHORS | 1 + WakaTime.py | 3 +++ WakaTime.sublime-settings | 3 +++ 3 files changed, 7 insertions(+) diff --git a/AUTHORS b/AUTHORS index 96c3db1..0b034db 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,3 +13,4 @@ Patches and Suggestions - Jimmy Selgen Nielsen - Patrik Kernstock +- Krishna Glick diff --git a/WakaTime.py b/WakaTime.py index e2d787e..2a78f90 100644 --- a/WakaTime.py +++ b/WakaTime.py @@ -462,6 +462,7 @@ class SendHeartbeatsThread(threading.Thread): self.debug = SETTINGS.get('debug') self.api_key = SETTINGS.get('api_key', '') self.ignore = SETTINGS.get('ignore', []) + self.include = SETTINGS.get('include', []) self.hidefilenames = SETTINGS.get('hidefilenames') self.proxy = SETTINGS.get('proxy') @@ -520,6 +521,8 @@ class SendHeartbeatsThread(threading.Thread): cmd.extend(['--cursorpos', heartbeat['cursorpos']]) for pattern in self.ignore: cmd.extend(['--exclude', pattern]) + for pattern in self.include: + cmd.extend(['--include', pattern]) if self.debug: cmd.append('--verbose') if self.hidefilenames: diff --git a/WakaTime.sublime-settings b/WakaTime.sublime-settings index 14f3987..5746ef6 100644 --- a/WakaTime.sublime-settings +++ b/WakaTime.sublime-settings @@ -17,6 +17,9 @@ // POSIX regular expressions will not be logged. "ignore": ["^/tmp/", "^/etc/", "^/var/(?!www/).*", "COMMIT_EDITMSG$", "PULLREQ_EDITMSG$", "MERGE_MSG$", "TAG_EDITMSG$"], + // Include files; Files (including absolute paths) that match one of these + "include": [".*"], + // Status bar message. Set to false to hide status bar message. // Defaults to true. "status_bar_message": true,