From 73c0b5055e7b76d34038b38d7ed7172155fabbd6 Mon Sep 17 00:00:00 2001 From: CHUN YU YAO Date: Sun, 21 Nov 2021 17:33:49 +0800 Subject: [PATCH] only update version name, no need to upgrade --- chrome_tixcraft.py | 14 +++++++++++++- settings.py | 11 ++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/chrome_tixcraft.py b/chrome_tixcraft.py index ac46258..44338c4 100644 --- a/chrome_tixcraft.py +++ b/chrome_tixcraft.py @@ -44,7 +44,7 @@ warnings.simplefilter('ignore',InsecureRequestWarning) #附註1:沒有寫的很好,很多地方應該可以模組化。 #附註2: -CONST_APP_VERSION = u"MaxBot (2021.03.22)" +CONST_APP_VERSION = u"MaxBot (2021.11.21)" CONST_FROM_TOP_TO_BOTTOM = u"from top to bottom" CONST_FROM_BOTTOM_TO_TOP = u"from bottom to top" @@ -103,12 +103,18 @@ kktix_answer_dictionary_list = None auto_guess_options = False +debugMode = False + if not config_dict is None: # read config. if 'homepage' in config_dict: homepage = config_dict["homepage"] if 'browser' in config_dict: browser = config_dict["browser"] + + # output debug message in client side. + if 'debug' in config_dict: + debugMode = config_dict["debug"] # default ticket number # 說明:自動選擇的票數 @@ -216,6 +222,7 @@ if not config_dict is None: print("area_keyword_2", area_keyword_2) print("pass_1_seat_remaining", pass_1_seat_remaining_enable) + print("debug Mode", debugMode) # entry point # 說明:自動開啟第一個的網頁 @@ -3101,6 +3108,9 @@ def main(): answer_index = -1 kktix_register_status_last = None + if debugMode: + print("Start to looping, detect browser url...") + while True: time.sleep(0.1) @@ -3285,6 +3295,8 @@ def main(): ''' # 說明:輸出目前網址,覺得吵的話,請註解掉這行。 + if debugMode: + print("url:", url) if len(url) > 0 : if url != last_url: print(url) diff --git a/settings.py b/settings.py index 62a1f94..1e93896 100644 --- a/settings.py +++ b/settings.py @@ -16,7 +16,7 @@ import os import sys import json -CONST_APP_VERSION = u"MaxBot (2021.03.22)" +CONST_APP_VERSION = u"MaxBot (2021.11.21)" CONST_FROM_TOP_TO_BOTTOM = u"from top to bottom" CONST_FROM_BOTTOM_TO_TOP = u"from bottom to top" @@ -355,6 +355,9 @@ def MainMenu(root): pass_1_seat_remaining_enable = False # default not checked. + debugMode = False + + global config_dict if not config_dict is None: # read config. @@ -364,6 +367,9 @@ def MainMenu(root): if u'browser' in config_dict: browser = config_dict["browser"] + if u'debug' in config_dict: + debugMode = config_dict["debug"] + # default ticket number # 說明:自動選擇的票數 ticket_number = "2" @@ -440,6 +446,7 @@ def MainMenu(root): pass_1_seat_remaining_enable = config_dict["tixcraft"]["pass_1_seat_remaining"] # output config: + print("version", CONST_APP_VERSION) print("homepage", homepage) print("browser", browser) print("ticket_number", ticket_number) @@ -467,6 +474,8 @@ def MainMenu(root): print("area_keyword_2", area_keyword_2) print("pass_1_seat_remaining", pass_1_seat_remaining_enable) + + print("debug Mode", debugMode) else: print('config is none')