-
Notifications
You must be signed in to change notification settings - Fork 0
/
consts.py
30 lines (23 loc) · 856 Bytes
/
consts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from aqt import mw
from aqt.theme import theme_manager
from pathlib import Path
global ADDON_NAME, ADDON_TITLE, ADDON_PATH, HOST, MEDIA_SERVER, DARK_MODE, PANEL_WIDTH, PATH_TO_HTML, PATH_TO_DATAFILE, CONFIG
ADDON_NAME = "1844476877"
ADDON_TITLE = mw.addonManager.addon_meta(ADDON_NAME).provided_name
ADDON_PATH = Path(__file__).parent.absolute().as_posix()
HOST = "localhost"
MEDIA_SERVER = mw.mediaServer
DARK_MODE = theme_manager.night_mode
PANEL_WIDTH = 600
PATH_TO_HTML = f"""web/index.html?dark={DARK_MODE}"""
PATH_TO_DATAFILE = f"""{ADDON_PATH}/user_files/data.json"""
CONFIG = mw.addonManager.getConfig(ADDON_NAME)
if(len(CONFIG) == 0):
CONFIG = {
"cardsToPlay": 1,
"linesPerPlay": 1,
"backgroundImage": "",
"highContrast": False
}
mw.addonManager.writeConfig(ADDON_NAME, CONFIG)
LINES_CLEARED = 0;