Update: Refactor to absolute imports, fix QPS limits, and enhance Gitea sync with SQLite support
This commit is contained in:
@@ -16,7 +16,17 @@ def select_file(log_widget, file_types=None, title="选择文件"):
|
||||
"""通用文件选择对话框"""
|
||||
if file_types is None:
|
||||
file_types = [("所有文件", "*.*")]
|
||||
file_path = filedialog.askopenfilename(title=title, filetypes=file_types)
|
||||
|
||||
# 获取默认输入目录
|
||||
try:
|
||||
config = ConfigManager()
|
||||
initial_dir = config.get_path('Paths', 'input_folder', fallback='data/input')
|
||||
if not os.path.exists(initial_dir):
|
||||
initial_dir = os.getcwd()
|
||||
except Exception:
|
||||
initial_dir = os.getcwd()
|
||||
|
||||
file_path = filedialog.askopenfilename(title=title, filetypes=file_types, initialdir=initial_dir)
|
||||
if file_path:
|
||||
add_to_log(log_widget, f"已选择文件: {file_path}\n", "info")
|
||||
return file_path
|
||||
|
||||
Reference in New Issue
Block a user