File size: 966 Bytes
f72f213
 
 
ebe28a6
28b906b
62f9d2c
cea9c8b
747bede
7d31175
747bede
 
cea9c8b
07895a2
 
fdf60dd
07895a2
fdf60dd
cea9c8b
fdf60dd
 
07895a2
fdf60dd
 
 
f72f213
a6d6814
747bede
28b906b
07895a2
a81ce99
 
 
d9abba5
a81ce99
747bede
 
 
f72f213
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
31
32
33
34
35
36
37
38
39
# -*- 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
        max_size = 128
    args = Arguments()

    set_theme("KonoSuba: Darkness Light")
    
    start_demo(args)