mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
Compare commits
8 Commits
11.0.6
...
feature/ap
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a387c08b44 | ||
![]() |
3c2947cf79 | ||
![]() |
54e6772a80 | ||
![]() |
b576dfafe6 | ||
![]() |
5299efd6fa | ||
![]() |
74583a6845 | ||
![]() |
31f1f8ecdc | ||
![]() |
c1f58fd05d |
20
HISTORY.rst
20
HISTORY.rst
@@ -3,6 +3,26 @@ History
|
|||||||
-------
|
-------
|
||||||
|
|
||||||
|
|
||||||
|
11.1.0 (2022-11-11)
|
||||||
|
++++++++++++++++++
|
||||||
|
|
||||||
|
- Support for api key vault cmd config
|
||||||
|
|
||||||
|
|
||||||
|
11.0.8 (2022-08-23)
|
||||||
|
++++++++++++++++++
|
||||||
|
|
||||||
|
- Bugfix to prevent using empty selection object.
|
||||||
|
`#116 <https://github.com/wakatime/sublime-wakatime/issues/116>`_
|
||||||
|
|
||||||
|
|
||||||
|
11.0.7 (2022-06-25)
|
||||||
|
++++++++++++++++++
|
||||||
|
|
||||||
|
- Check wakatime-cli versions in background thread.
|
||||||
|
`#115 <https://github.com/wakatime/sublime-wakatime/issues/115>`_
|
||||||
|
|
||||||
|
|
||||||
11.0.6 (2022-06-08)
|
11.0.6 (2022-06-08)
|
||||||
++++++++++++++++++
|
++++++++++++++++++
|
||||||
|
|
||||||
|
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
[WakaTime][wakatime] is an open source Sublime Text plugin for metrics, insights, and time tracking automatically generated from your programming activity.
|
[WakaTime][wakatime] is an open source Sublime Text plugin for metrics, insights, and time tracking automatically generated from your programming activity.
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
1. Install [Package Control](https://packagecontrol.io/installation).
|
1. Install [Package Control](https://packagecontrol.io/installation).
|
||||||
@@ -19,12 +18,10 @@
|
|||||||
|
|
||||||
6. Use Sublime and your coding activity will be displayed on your [WakaTime dashboard](https://wakatime.com).
|
6. Use Sublime and your coding activity will be displayed on your [WakaTime dashboard](https://wakatime.com).
|
||||||
|
|
||||||
|
|
||||||
## Screen Shots
|
## Screen Shots
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
## Unresponsive Plugin Warning
|
## Unresponsive Plugin Warning
|
||||||
|
|
||||||
In Sublime Text 2, if you get a warning message:
|
In Sublime Text 2, if you get a warning message:
|
||||||
@@ -35,7 +32,6 @@ To fix this, go to `Preferences → Settings - User` then add the following sett
|
|||||||
|
|
||||||
`"detect_slow_plugins": false`
|
`"detect_slow_plugins": false`
|
||||||
|
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
First, turn on debug mode in your `WakaTime.sublime-settings` file.
|
First, turn on debug mode in your `WakaTime.sublime-settings` file.
|
||||||
|
34
WakaTime.py
34
WakaTime.py
@@ -8,7 +8,7 @@ Website: https://wakatime.com/
|
|||||||
==========================================================="""
|
==========================================================="""
|
||||||
|
|
||||||
|
|
||||||
__version__ = '11.0.6'
|
__version__ = '11.0.8'
|
||||||
|
|
||||||
|
|
||||||
import sublime
|
import sublime
|
||||||
@@ -194,11 +194,32 @@ class ApiKey(object):
|
|||||||
if key:
|
if key:
|
||||||
self._key = key
|
self._key = key
|
||||||
return self._key
|
return self._key
|
||||||
|
|
||||||
|
apiKeyFromVault = self.__readFromVaultCmd()
|
||||||
|
if apiKeyFromVault:
|
||||||
|
self._key = apiKeyFromVault
|
||||||
|
return self._key
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return self._key
|
return self._key
|
||||||
|
|
||||||
|
def __readFromVaultCmd(self):
|
||||||
|
apiKeyCmd = SETTINGS.get('api_key_vault_cmd')
|
||||||
|
if not apiKeyCmd:
|
||||||
|
return None
|
||||||
|
|
||||||
|
try:
|
||||||
|
p = Popen(apiKeyCmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||||
|
stdout, stderr = p.communicate()
|
||||||
|
if p.returncode == 0:
|
||||||
|
return stdout.strip()
|
||||||
|
log(WARNING, u(stderr))
|
||||||
|
except:
|
||||||
|
log(ERROR, traceback.format_exc())
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
def write(self, key):
|
def write(self, key):
|
||||||
global SETTINGS
|
global SETTINGS
|
||||||
self._key = key
|
self._key = key
|
||||||
@@ -422,7 +443,7 @@ def append_heartbeat(entity, timestamp, is_write, view, project, folders):
|
|||||||
'lines_in_file': view.rowcol(view.size())[0] + 1,
|
'lines_in_file': view.rowcol(view.size())[0] + 1,
|
||||||
}
|
}
|
||||||
selections = view.sel()
|
selections = view.sel()
|
||||||
if selections:
|
if selections and len(selections) > 0:
|
||||||
rowcol = view.rowcol(selections[0].begin())
|
rowcol = view.rowcol(selections[0].begin())
|
||||||
row, col = rowcol[0] + 1, rowcol[1] + 1
|
row, col = rowcol[0] + 1, rowcol[1] + 1
|
||||||
heartbeat['lineno'] = row
|
heartbeat['lineno'] = row
|
||||||
@@ -594,9 +615,7 @@ def plugin_loaded():
|
|||||||
log(INFO, 'Initializing WakaTime plugin v%s' % __version__)
|
log(INFO, 'Initializing WakaTime plugin v%s' % __version__)
|
||||||
update_status_bar('Initializing...')
|
update_status_bar('Initializing...')
|
||||||
|
|
||||||
if not isCliLatest():
|
UpdateCLI().start()
|
||||||
thread = DownloadCLI()
|
|
||||||
thread.start()
|
|
||||||
|
|
||||||
after_loaded()
|
after_loaded()
|
||||||
|
|
||||||
@@ -632,11 +651,14 @@ class WakatimeDashboardCommand(sublime_plugin.ApplicationCommand):
|
|||||||
webbrowser.open_new_tab('https://wakatime.com/dashboard')
|
webbrowser.open_new_tab('https://wakatime.com/dashboard')
|
||||||
|
|
||||||
|
|
||||||
class DownloadCLI(threading.Thread):
|
class UpdateCLI(threading.Thread):
|
||||||
"""Non-blocking thread for downloading latest wakatime-cli from GitHub.
|
"""Non-blocking thread for downloading latest wakatime-cli from GitHub.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
if isCliLatest():
|
||||||
|
return
|
||||||
|
|
||||||
log(INFO, 'Downloading wakatime-cli...')
|
log(INFO, 'Downloading wakatime-cli...')
|
||||||
|
|
||||||
if os.path.isdir(os.path.join(RESOURCES_FOLDER, 'wakatime-cli')):
|
if os.path.isdir(os.path.join(RESOURCES_FOLDER, 'wakatime-cli')):
|
||||||
|
Reference in New Issue
Block a user