[Refactor] Main Window: _printToTextbox. textboxへの出力関数のリファクタリング2

textbox widget指定を_printToTextbox関数内で行うように。
This commit is contained in:
Sakamoto Shiina
2023-09-14 05:13:47 +09:00
parent 6af238b754
commit f27e4985cd
2 changed files with 18 additions and 12 deletions

View File

@@ -1,7 +1,20 @@
from datetime import datetime
from customtkinter import CTkFont
def _printToTextbox(settings, target_textbox, original_message=None, translated_message=None, tags=None):
def _printToTextbox(vrct_gui, settings, target_type, original_message=None, translated_message=None, tags=None):
match (target_type):
case "ALL":
target_textbox = vrct_gui.textbox_all
case "INFO":
target_textbox = vrct_gui.textbox_system
case "SEND":
target_textbox = vrct_gui.textbox_sent
case "RECEIVE":
target_textbox = vrct_gui.textbox_received
case (_):
raise ValueError(f"No matching case for target_type: {target_type}")
now_raw_data = datetime.now()
now = now_raw_data.strftime('%H:%M:%S')
now_hm = now_raw_data.strftime('%H:%M')