reduce a thread, show running on PORT debug message.
parent
600433be1f
commit
66d62cef21
|
@ -41,7 +41,7 @@ try:
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
CONST_APP_VERSION = "MaxBot (2024.01.08)"
|
CONST_APP_VERSION = "MaxBot (2024.01.09)"
|
||||||
|
|
||||||
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
|
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
|
||||||
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
||||||
|
@ -618,13 +618,11 @@ def dump_settins_to_maxbot_plus_extension(ext, config_dict):
|
||||||
line = line.replace('display: none;','')
|
line = line.replace('display: none;','')
|
||||||
new_html_array.append(line)
|
new_html_array.append(line)
|
||||||
if len(new_html_array) > 0:
|
if len(new_html_array) > 0:
|
||||||
print("output new options.html")
|
#print("output new options.html")
|
||||||
with open(target_path, 'w') as outfile:
|
with open(target_path, 'w') as outfile:
|
||||||
outfile.write("".join(new_html_array))
|
outfile.write("".join(new_html_array))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_uc_options(uc, config_dict, webdriver_path):
|
def get_uc_options(uc, config_dict, webdriver_path):
|
||||||
options = uc.ChromeOptions()
|
options = uc.ChromeOptions()
|
||||||
options.page_load_strategy = 'eager'
|
options.page_load_strategy = 'eager'
|
||||||
|
|
|
@ -22,7 +22,7 @@ import sys
|
||||||
import threading
|
import threading
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
|
||||||
CONST_APP_VERSION = "MaxBot (2024.01.08)"
|
CONST_APP_VERSION = "MaxBot (2024.01.09)"
|
||||||
|
|
||||||
CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json"
|
CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json"
|
||||||
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
||||||
|
|
15
settings.py
15
settings.py
|
@ -38,7 +38,7 @@ try:
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
CONST_APP_VERSION = "MaxBot (2024.01.08)"
|
CONST_APP_VERSION = "MaxBot (2024.01.09)"
|
||||||
|
|
||||||
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
|
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
|
||||||
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
||||||
|
@ -100,6 +100,8 @@ URL_CHROME_DRIVER = 'https://chromedriver.chromium.org/'
|
||||||
URL_FIREFOX_DRIVER = 'https://github.com/mozilla/geckodriver/releases'
|
URL_FIREFOX_DRIVER = 'https://github.com/mozilla/geckodriver/releases'
|
||||||
URL_EDGE_DRIVER = 'https://developer.microsoft.com/zh-tw/microsoft-edge/tools/webdriver/'
|
URL_EDGE_DRIVER = 'https://developer.microsoft.com/zh-tw/microsoft-edge/tools/webdriver/'
|
||||||
|
|
||||||
|
GLOBAL_SERVER_SHUTDOWN = False
|
||||||
|
|
||||||
def load_translate():
|
def load_translate():
|
||||||
translate = {}
|
translate = {}
|
||||||
en_us={}
|
en_us={}
|
||||||
|
@ -2422,12 +2424,10 @@ def resetful_api_timer():
|
||||||
while True:
|
while True:
|
||||||
btn_preview_text_clicked()
|
btn_preview_text_clicked()
|
||||||
preview_question_text_file()
|
preview_question_text_file()
|
||||||
time.sleep(0.2)
|
|
||||||
|
|
||||||
def settings_timer():
|
|
||||||
while True:
|
|
||||||
update_maxbot_runtime_status()
|
update_maxbot_runtime_status()
|
||||||
time.sleep(0.6)
|
time.sleep(0.3)
|
||||||
|
if GLOBAL_SERVER_SHUTDOWN:
|
||||||
|
break
|
||||||
|
|
||||||
def clean_extension_status():
|
def clean_extension_status():
|
||||||
Root_Dir = get_app_root()
|
Root_Dir = get_app_root()
|
||||||
|
@ -2765,9 +2765,9 @@ def main():
|
||||||
root.call('wm', 'iconphoto', root._w, logo)
|
root.call('wm', 'iconphoto', root._w, logo)
|
||||||
os.remove(icon_filepath)
|
os.remove(icon_filepath)
|
||||||
|
|
||||||
threading.Thread(target=settings_timer, daemon=True).start()
|
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
print("exit settings")
|
print("exit settings")
|
||||||
|
GLOBAL_SERVER_SHUTDOWN=True
|
||||||
clean_extension_status()
|
clean_extension_status()
|
||||||
|
|
||||||
def force_remove_file(filepath):
|
def force_remove_file(filepath):
|
||||||
|
@ -2918,6 +2918,7 @@ async def main_server():
|
||||||
app.version = CONST_APP_VERSION;
|
app.version = CONST_APP_VERSION;
|
||||||
|
|
||||||
app.listen(CONST_SERVER_PORT)
|
app.listen(CONST_SERVER_PORT)
|
||||||
|
print("server running on port:", CONST_SERVER_PORT)
|
||||||
await asyncio.Event().wait()
|
await asyncio.Event().wait()
|
||||||
|
|
||||||
def web_server():
|
def web_server():
|
||||||
|
|
Loading…
Reference in New Issue