ErisPulse 1.1.10__py3-none-any.whl → 1.1.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ErisPulse/__init__.py +9 -3
- ErisPulse/__main__.py +600 -198
- ErisPulse/adapter.py +16 -7
- ErisPulse/db.py +5 -2
- ErisPulse/mods.py +5 -0
- ErisPulse/util.py +28 -2
- {erispulse-1.1.10.dist-info → erispulse-1.1.11.dist-info}/METADATA +13 -3
- erispulse-1.1.11.dist-info/RECORD +14 -0
- erispulse-1.1.10.dist-info/RECORD +0 -14
- {erispulse-1.1.10.dist-info → erispulse-1.1.11.dist-info}/WHEEL +0 -0
- {erispulse-1.1.10.dist-info → erispulse-1.1.11.dist-info}/entry_points.txt +0 -0
- {erispulse-1.1.10.dist-info → erispulse-1.1.11.dist-info}/licenses/LICENSE +0 -0
- {erispulse-1.1.10.dist-info → erispulse-1.1.11.dist-info}/top_level.txt +0 -0
ErisPulse/__init__.py
CHANGED
|
@@ -30,10 +30,12 @@ raiserr.register("InvalidDependencyError" , doc="依赖无效错误")
|
|
|
30
30
|
raiserr.register("CycleDependencyError" , doc="依赖循环错误")
|
|
31
31
|
raiserr.register("ModuleLoadError" , doc="模块加载错误")
|
|
32
32
|
|
|
33
|
-
def init():
|
|
33
|
+
def init() -> None:
|
|
34
34
|
try:
|
|
35
35
|
logger.info("[Init] SDK 正在初始化...")
|
|
36
|
-
env.create_env_file_if_not_exists()
|
|
36
|
+
if env.create_env_file_if_not_exists():
|
|
37
|
+
logger.info("[Init] 项目首次初始化,建议先配置环境变量")
|
|
38
|
+
sys.exit(0)
|
|
37
39
|
env.load_env_file()
|
|
38
40
|
|
|
39
41
|
sdkModulePath = os.path.join(os.path.dirname(__file__), "modules")
|
|
@@ -131,6 +133,11 @@ def init():
|
|
|
131
133
|
sdkInstalledModuleNames: list[str] = sdk.util.topological_sort(
|
|
132
134
|
sdkInstalledModuleNames, sdkModuleDependencies, raiserr.CycleDependencyError
|
|
133
135
|
)
|
|
136
|
+
# 存储模块依赖关系到env
|
|
137
|
+
env.set('module_dependencies', {
|
|
138
|
+
'modules': sdkInstalledModuleNames,
|
|
139
|
+
'dependencies': sdkModuleDependencies
|
|
140
|
+
})
|
|
134
141
|
|
|
135
142
|
# ==== 注册适配器 ====
|
|
136
143
|
logger.debug("[Init] 开始注册适配器...")
|
|
@@ -174,7 +181,6 @@ def init():
|
|
|
174
181
|
setattr(moduleMain, "moduleInfo", moduleObj.moduleInfo)
|
|
175
182
|
setattr(sdk, meta_name, moduleMain)
|
|
176
183
|
logger.debug(f"模块 {meta_name} 正在初始化")
|
|
177
|
-
|
|
178
184
|
except Exception as e:
|
|
179
185
|
raiserr.InitError(f"sdk初始化失败: {e}", exit=True)
|
|
180
186
|
|