mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
prompt user for api key if one does not already exist
This commit is contained in:
parent
9a4064a3c3
commit
d4ed92d6de
@ -35,6 +35,16 @@ if isfile(expanduser('~/.wakatime')):
|
||||
])
|
||||
|
||||
|
||||
# Create config file if it does not already exist
|
||||
if not isfile(expanduser('~/.wakatime.conf')) or True:
|
||||
def got_key(text):
|
||||
if text:
|
||||
cfg = open(expanduser('~/.wakatime.conf'), 'w')
|
||||
cfg.write('api_key=%s' % text)
|
||||
cfg.close()
|
||||
sublime.active_window().show_input_panel('Enter your WakaTi.me api key:', '', got_key, None, None)
|
||||
|
||||
|
||||
def api(targetFile, timestamp, isWrite=False, endtime=None):
|
||||
global LAST_ACTION, LAST_USAGE, LAST_FILE
|
||||
if not targetFile:
|
||||
|
Loading…
Reference in New Issue
Block a user