Remove hardcoded api domain (or rather make it less hardcoded)
This commit is contained in:
parent
67d8b0d24f
commit
c1240349dd
2 changed files with 6 additions and 2 deletions
|
@ -3,6 +3,7 @@ sublime-wakatime
|
|||
|
||||
Metrics, insights, and time tracking automatically generated from your programming activity.
|
||||
|
||||
This is a fork, modified to make it easier to use with rana or any other wakatime-compatible time tracking tools.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
|
|
@ -27,6 +27,9 @@ from .packages import tzlocal
|
|||
|
||||
log = logging.getLogger('WakaTime')
|
||||
|
||||
api_domain = "https://api.wakatime.com"
|
||||
# api_domain = https://rana.lavatech.top/
|
||||
|
||||
|
||||
try:
|
||||
from .packages import requests
|
||||
|
@ -49,7 +52,7 @@ def send_heartbeats(heartbeats, args, configs, use_ntlm_proxy=False):
|
|||
|
||||
api_url = args.api_url
|
||||
if not api_url:
|
||||
api_url = 'https://api.wakatime.com/api/v1/users/current/heartbeats.bulk'
|
||||
api_url = '{}/api/v1/users/current/heartbeats.bulk'.format(api_domain)
|
||||
log.debug('Sending heartbeats to api at %s' % api_url)
|
||||
timeout = args.timeout
|
||||
if not timeout:
|
||||
|
@ -171,7 +174,7 @@ def get_time_today(args, use_ntlm_proxy=False):
|
|||
fetch summary.
|
||||
"""
|
||||
|
||||
url = 'https://api.wakatime.com/api/v1/users/current/summaries'
|
||||
url = '{}/api/v1/users/current/summaries'.format(api_domain)
|
||||
timeout = args.timeout
|
||||
if not timeout:
|
||||
timeout = 60
|
||||
|
|
Loading…
Reference in a new issue