launcher/launcher.py

18 lines
472 B
Python

import mimetypes
import shutil
from pathlib import Path
from launcher.constants import update_tmp_folder
from launcher.webview import start_webview
mimetypes.add_type("text/html", ".html")
mimetypes.add_type("text/css", ".css")
mimetypes.add_type("application/javascript", ".js")
if __name__ == '__main__':
# 如果当前路径存在临时文件夹,则删除
if Path(update_tmp_folder).exists():
shutil.rmtree(update_tmp_folder)
start_webview()