mirror of
https://github.com/csd4ni3l/siege-calendar.git
synced 2026-01-01 04:23:47 +01:00
Fix Client not being able to connect on Windows
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
import os, requests, configparser
|
||||
import os, requests, configparser, sys
|
||||
from datetime import date, datetime, timedelta
|
||||
from utils.constants import HACKATIME_URL
|
||||
from pathlib import Path
|
||||
|
||||
class Client:
|
||||
def __init__(self):
|
||||
wakatime_config_path = Path.home() / ".wakatime.cfg"
|
||||
|
||||
if not os.path.exists(wakatime_config_path):
|
||||
print("Wakatime config file doesnt exist, so we cant connect to Hackatime. Exiting...")
|
||||
sys.exit(1)
|
||||
|
||||
self.config = configparser.ConfigParser()
|
||||
self.config.read(os.path.expanduser("~/.wakatime.cfg"))
|
||||
self.config.read(wakatime_config_path)
|
||||
|
||||
self.api_url = HACKATIME_URL
|
||||
self.api_key = self.config["settings"]["api_key"]
|
||||
|
||||
Reference in New Issue
Block a user