wfd / app.py
wdcqc's picture
Update app.py
07895a2
raw
history blame
943 Bytes
# -*- coding: utf-8 -*-
# Copyright @ 2023 wdcqc/aieud project.
# Open-source under license obtainable in project root (LICENSE.md).
import argparse
import os
import urllib.request
import json
import importlib
# do it properly
WFD_DIR = os.path.dirname(importlib.util.find_spec("wfd").origin)
def set_theme(theme):
settings_file = os.path.join(WFD_DIR, "webui", "doki_settings.json")
try:
with open(settings_file, encoding = "utf-8") as fp:
doki = json.load(fp)
doki["theme"] = theme
with open(settings_file, "w", encoding = "utf-8") as fp:
json.dump(doki, fp)
except Exception as e:
print(e)
if __name__ == "__main__":
print("WFD_DIR =", WFD_DIR)
from wfd.webui import start_demo
class Arguments:
colab = False
link_to_colab = True
args = Arguments()
set_theme("KonoSuba: Darkness Light")
start_demo(args)