def _create_text_boxs(self): # 建立所有的文本输入框 # affiliation id text # label text_frame = tk.Frame(self) text_frame.pack(padx=2, pady=2) self.affiliation_id_textbox = TextBox(text_frame, '单位 ID(AFIL ID)输入框', width=40, textwrap=tk.NONE) self.affiliation_id_textbox.grid(row=0, column=0) self.api_key_textbox = TextBox(text_frame, 'API KEY 输入框', width=40, textwrap=tk.NONE) self.api_key_textbox.grid(row=0, column=1)
def _create_text_boxs(self): # 建立所有的文本输入框 # author id text # label text_frame = tk.Frame(self) text_frame.pack(padx=2, pady=2) self.author_id_textbox = TextBox(text_frame, '作者 ID(AUTHOR ID)输入框', width=40, textwrap=tk.NONE) self.author_id_textbox.grid(row=0, column=0) self.api_key_textbox = TextBox(text_frame, 'API KEY 输入框', width=40, textwrap=tk.NONE) self.api_key_textbox.grid(row=0, column=1)
def _create_text_boxs(self): # 建立所有的文本输入框 # affiliation id text # label text_frame = tk.Frame(self) text_frame.grid(row=0, column=0, columnspan=3) self.affiliation_id_textbox = TextBox(text_frame, '单位ID(Affiliation ID)输入框', width=40, textwrap=tk.NONE) self.affiliation_id_textbox.grid(row=0, column=0) self.author_id_textbox = TextBox(text_frame, '作者ID(Author ID)输入框', width=40, textwrap=tk.NONE) self.author_id_textbox.grid(row=0, column=1) self.api_key_textbox = TextBox(text_frame, 'API KEY 输入框', width=40, textwrap=tk.NONE) self.api_key_textbox.grid(row=0, column=2)
def _create_log_box(self): log_box = tk.Frame(self) log_box.pack(side=tk.BOTTOM, expand=True, padx=2, pady=2) self.log_text_box = TextBox(log_box, '运行记录', width=80, textwrap=tk.NONE) self.log_text_box.grid(row=0, column=0) widget_handler = WidgetLogger(self.log_text_box) debug_formatter = logging.Formatter( '%(asctime)s - %(name)s - %(levelname)s - %(message)s') info_formatter = logging.Formatter( '%(asctime)s - %(levelname)s - %(message)s') if logger.level == logging.DEBUG: widget_handler.setFormatter(debug_formatter) else: widget_handler.setFormatter(info_formatter) logger.addHandler(widget_handler)