-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
39 lines (31 loc) · 825 Bytes
/
main.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
31
32
33
34
35
36
37
38
39
import argparse
import logging
import os
import webview
from runetranslator.api import Api
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"-C",
"--conf",
default="./config.json",
type=str,
help="Path to the config file.",
)
parser.add_argument(
"-D",
"--debug",
default=False,
action="store_true",
help="debug mode.",
)
args, _ = parser.parse_known_args()
if args.debug:
logging.getLogger().setLevel(logging.DEBUG)
api = Api(args.conf)
api.window = webview.create_window(
"RuneTranslator",
f"{os.path.dirname(__file__) or '.'}/runetranslator/frontend/index.vue.html",
js_api=api,
)
webview.start(api.start, debug=args.debug)