style: format all Python files with Black

Apply Black formatter to the entire codebase for consistent code style.

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-02-26 22:44:03 +08:00
parent 1b16842a2c
commit 3b7c00377f
46 changed files with 1488 additions and 974 deletions

View File

@@ -36,7 +36,9 @@ class MainWindow:
# 设置窗口属性(包含用户信息)
user_type_display = "管理员" if session_manager.is_admin() else "用户"
self.root.title(f"ERP 自动化工具 v1.0 - {session_manager.get_username()} ({user_type_display})")
self.root.title(
f"ERP 自动化工具 v1.0 - {session_manager.get_username()} ({user_type_display})"
)
self.root.geometry("1000x700")
# 设置最小窗口大小
@@ -62,8 +64,8 @@ class MainWindow:
"""更新共享的 Production ID 列表"""
self.shared_production_ids = production_ids
# 通知物料校验标签页 Production ID 已更新
if hasattr(self, 'validation_tab'):
if hasattr(self.validation_tab, 'on_production_ids_updated'):
if hasattr(self, "validation_tab"):
if hasattr(self.validation_tab, "on_production_ids_updated"):
self.validation_tab.on_production_ids_updated(production_ids)
def create_menu(self):
@@ -92,11 +94,15 @@ class MainWindow:
self.notebook.add(self.extraction_tab, text="数据提取")
# 物料校验标签页(传入 session_manager 和 main_window
self.validation_tab = MaterialValidationTab(self.notebook, self.config, self.session_manager, self)
self.validation_tab = MaterialValidationTab(
self.notebook, self.config, self.session_manager, self
)
self.notebook.add(self.validation_tab, text="物料校验")
# 设置标签页(传入 session_manager
self.settings_tab = SettingsTab(self.notebook, self.config, self.session_manager)
self.settings_tab = SettingsTab(
self.notebook, self.config, self.session_manager
)
self.notebook.add(self.settings_tab, text="设置")
# 初始化:如果数据提取页面已有 Production ID通知物料校验页面
@@ -105,7 +111,7 @@ class MainWindow:
def _initialize_shared_production_ids(self):
"""初始化共享的 Production ID从数据提取页面获取"""
try:
if hasattr(self.extraction_tab, 'production_id_input'):
if hasattr(self.extraction_tab, "production_id_input"):
production_ids = self.extraction_tab.production_id_input.get()
if production_ids:
self.update_shared_production_ids(production_ids)
@@ -134,7 +140,9 @@ class MainWindow:
user_info_text = f"当前用户: {self.session_manager.get_username()} ({user_type_display}) - 以 {original_admin['username']} 身份登录"
else:
# 正常登录
user_info_text = f"当前用户: {self.session_manager.get_username()} ({user_type_display})"
user_info_text = (
f"当前用户: {self.session_manager.get_username()} ({user_type_display})"
)
self.user_info_var = tk.StringVar()
self.user_info_var.set(user_info_text)
@@ -181,9 +189,9 @@ class MainWindow:
self.config.reload()
# 通知各个标签页重新加载配置
if hasattr(self.extraction_tab, 'reload_config'):
if hasattr(self.extraction_tab, "reload_config"):
self.extraction_tab.reload_config()
if hasattr(self.validation_tab, 'reload_config'):
if hasattr(self.validation_tab, "reload_config"):
self.validation_tab.reload_config()
# 更新状态栏