add telemetry using posthog

+ move build variables into a python file
+ rewrite logic to check if there's an internet connection
+ move IS_BUILD into settings
+ update pyintaller to 6.0.0
+ update other packages to latest
This commit is contained in:
mungai-njoroge
2023-09-25 20:27:20 +03:00
parent 50ebead026
commit ba88cf4a23
12 changed files with 456 additions and 215 deletions
+15
View File
@@ -2,10 +2,18 @@
Contains default configs
"""
import os
import sys
from typing import Any
from app import configs
join = os.path.join
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
IS_BUILD = True
else:
IS_BUILD = False
class Release:
APP_VERSION = "1.3.0"
@@ -224,3 +232,10 @@ class TCOLOR:
class Keys:
# get last fm api key from os environment
LASTFM_API = os.environ.get("LASTFM_API_KEY")
POSTHOG_API_KEY = os.environ.get("POSTHOG_API_KEY")
@classmethod
def load(cls):
if IS_BUILD:
cls.LASTFM_API = configs.LASTFM_API_KEY
cls.POSTHOG_API_KEY = configs.POSTHOG_API_KEY