Example #1
0
 def reset_command():
     """将添加了前后功能处理的函数添加到目录中"""
     RunTimeData.reset()
     Interface.functional_area_clean()
     _description(description)
     RunTimeData.set_components(components)
     for component in components:
         component.show()
     _run(run_func)
     Message.info(f"选择功能: {name}")
Example #2
0
 def _select_dir(self):
     """选择文件夹"""
     select_dir_path = filedialog.askdirectory(
         title=f"选择 {self._button_text} 对应文件夹")
     if select_dir_path:
         Message.info("选择文件夹:" + select_dir_path)
         self._value = select_dir_path
         self._label_str.set(select_dir_path)
     else:
         Message.warning("未选择文件夹")
Example #3
0
 def _select_file(self):
     """选择指定格式文件"""
     select_file_path = filedialog.askopenfilename(
         title=f'选择 {self._button_text} 文件',
         filetypes=_file_types(self._file_types))
     if select_file_path:
         Message.info("选择文件:" + select_file_path)
         self._value = select_file_path
         self._label_str.set(select_file_path)
     else:
         Message.warning("未选择文件")
Example #4
0
 def _select_files(self):
     """选择指定格式文件"""
     select_file_paths = filedialog.askopenfilenames(
         title=f'选择 {self._button_text} 对应的多个文件',
         filetypes=_file_types(self._file_types))
     if select_file_paths:
         self._value = select_file_paths
         self._label_str.set(
             json.dumps(select_file_paths, ensure_ascii=False))
         Message.info("选择的多个文件为:")
         for file_path in select_file_paths:
             Message.info(file_path)
     else:
         Message.warning("未选择文件")