import re from .ui.mil_tool import FrameMILTool from .core.companion_loader import load_companions from .core.manifest import COMPANION_PACKAGES # 工具名称 NMAE = "MIL Tool" # 工具版本 __MAJOR_VER: int = 0 # 主版本号 __MINOR_VER: int = 0 # 次版本号 __MICRO_VER: int = 4 # 修订版本号 VERSION:str = f"{__MAJOR_VER}.{__MINOR_VER}.{__MICRO_VER}" # 工具描述 DESCRIPITION = """ 主要用于生成Simlink Test Case。 """ SVG = """ """ # 伴生包清单从 manifest 导入(唯一事实源),此处保留引用以兼容旧调用方 # 加新伴生包:改 mil/core/manifest.py 的 COMPANION_PACKAGES,不要改这里 def create_plugin(workspace, parent=None): # 先挂伴生包,再构造 UI——mil 包内任何 import openpyxl 都将命中 build/ 下的 pyd load_companions(COMPANION_PACKAGES) return FrameMILTool(workspace, parent) def create_plugin_svg(file:str): with open(file,'w', encoding='utf-8') as f: f.write(SVG.strip()) f.close() def read_plugin_name(): return NMAE def read_plugin_version(): return VERSION def read_plugin_description(): return re.sub(r'^[\r\n]+',"",DESCRIPITION) __all__ = [ "create_plugin", "create_plugin_svg", "read_plugin_name", "read_plugin_version", "read_plugin_description", ]