mirror of
https://github.com/emendir/EndraApp.git
synced 2026-04-26 09:17:58 -04:00
42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
|
|
import _testing_utils
|
|
from endra_app import _load_kivy # load kivy with better font handling
|
|
import shutil
|
|
import walytis_beta_api as walytis_api
|
|
from endra_app import config
|
|
from endra_app.config import APPDATA_DIR
|
|
import os
|
|
import endra_app
|
|
from endra_app import run
|
|
|
|
|
|
_testing_utils.assert_is_loaded_from_source(
|
|
source_dir=os.path.join(os.path.dirname(__file__), "..", ".."), module=config
|
|
)
|
|
_testing_utils.assert_is_loaded_from_source(
|
|
source_dir=os.path.join(os.path.dirname(__file__), "..", ".."), module=endra_app
|
|
)
|
|
WORKING_DIR = os.path.join(os.path.dirname(__file__))
|
|
APPDATA_BACKUP_DIR = os.path.join(
|
|
WORKING_DIR, "appdata"
|
|
)
|
|
|
|
# do something with _load_kivy to stop IDEs from removing the import
|
|
print("Using Pango Font Context:",_load_kivy.using_pango)
|
|
|
|
|
|
# replace appdata with appdata backup
|
|
if not os.path.exists(APPDATA_BACKUP_DIR):
|
|
os.makedirs(APPDATA_BACKUP_DIR)
|
|
if os.path.exists(APPDATA_DIR):
|
|
shutil.rmtree(APPDATA_DIR)
|
|
shutil.copytree(APPDATA_BACKUP_DIR, APPDATA_DIR)
|
|
|
|
# run Endra App
|
|
run()
|
|
|
|
# copy appdata back into appdata backup
|
|
if os.path.exists(APPDATA_BACKUP_DIR):
|
|
shutil.rmtree(APPDATA_BACKUP_DIR)
|
|
shutil.copytree(APPDATA_DIR, APPDATA_BACKUP_DIR)
|