2024-01-07, just change version code.

master
Your Name 2024-01-15 14:40:44 +08:00
parent a24c30fb86
commit 322ef1093b
5 changed files with 29 additions and 6 deletions

View File

@ -41,7 +41,7 @@ try:
except Exception as exc: except Exception as exc:
pass pass
CONST_APP_VERSION = "MaxBot (2024.01.06)" CONST_APP_VERSION = "MaxBot (2024.01.07)"
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"
@ -558,6 +558,7 @@ def clean_uc_exe_cache():
return is_cache_exist return is_cache_exist
def dump_settins_to_maxbot_plus_extension(ext, config_dict): def dump_settins_to_maxbot_plus_extension(ext, config_dict):
# sync config.
target_path = ext target_path = ext
target_path = os.path.join(target_path, "data") target_path = os.path.join(target_path, "data")
target_path = os.path.join(target_path, CONST_MAXBOT_CONFIG_FILE) target_path = os.path.join(target_path, CONST_MAXBOT_CONFIG_FILE)
@ -569,6 +570,7 @@ def dump_settins_to_maxbot_plus_extension(ext, config_dict):
with open(target_path, 'w') as outfile: with open(target_path, 'w') as outfile:
json.dump(config_dict, outfile) json.dump(config_dict, outfile)
# add host_permissions
target_path = ext target_path = ext
target_path = os.path.join(target_path, "manifest.json") target_path = os.path.join(target_path, "manifest.json")
@ -601,6 +603,27 @@ def dump_settins_to_maxbot_plus_extension(ext, config_dict):
with open(target_path, 'w') as outfile: with open(target_path, 'w') as outfile:
outfile.write(json_str) outfile.write(json_str)
# show advanced rows in extension.
target_path = ext
target_path = os.path.join(target_path, "options.html")
if os.path.isfile(target_path):
file_options = open(target_path, 'r')
html_lines = file_options.readlines()
file_options.close()
new_html_array = []
my_target_row = ['remote_url_row','ocr_captcha_enable_row']
for line in html_lines:
for row in my_target_row:
if row in line:
line = line.replace('display: none;','')
new_html_array.append(line)
if len(new_html_array) > 0:
print("output new options.html")
with open(target_path, 'w') as outfile:
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()

View File

@ -22,7 +22,7 @@ import sys
import threading import threading
import webbrowser import webbrowser
CONST_APP_VERSION = "MaxBot (2024.01.06)" CONST_APP_VERSION = "MaxBot (2024.01.07)"
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"

View File

@ -38,7 +38,7 @@ try:
except Exception as exc: except Exception as exc:
pass pass
CONST_APP_VERSION = "MaxBot (2024.01.06)" CONST_APP_VERSION = "MaxBot (2024.01.07)"
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"

View File

@ -29,7 +29,7 @@
"declarativeNetRequestFeedback" "declarativeNetRequestFeedback"
], ],
"host_permissions": [ "host_permissions": [
"http://maxbot.dropboxlike.com:16888/*" "http://127.0.0.1:16888/*"
], ],
"web_accessible_resources": [ "web_accessible_resources": [
{ {

View File

@ -95,7 +95,7 @@
</div> </div>
</div> </div>
<div class="col-12"> <div class="col-12" id="ocr_captcha_enable_row" style="">
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" id="ocr_captcha_enable"> <input class="form-check-input" type="checkbox" id="ocr_captcha_enable">
<label class="form-check-label" for="ocr_captcha_enable"> <label class="form-check-label" for="ocr_captcha_enable">
@ -104,7 +104,7 @@
</div> </div>
</div> </div>
<div class="col-12"> <div class="col-12" id="remote_url_row" style="">
<label for="remote_url" class="form-label">OCR Server URL</label> <label for="remote_url" class="form-label">OCR Server URL</label>
<input class="form-control" id="remote_url" value="" /> <input class="form-control" id="remote_url" value="" />
</div> </div>