fix
This commit is contained in:
@@ -1 +1,2 @@
|
||||
print("Hello from HeurAMS Program :)")
|
||||
|
||||
|
||||
@@ -6,12 +6,18 @@ from contextvars import ContextVar
|
||||
import pathlib
|
||||
from heurams.services.config import ConfigFile
|
||||
|
||||
# 默认配置文件路径规定: 以包目录为准
|
||||
# 用户配置文件路径规定: 以运行目录为准
|
||||
# 数据文件路径规定: 以运行目录为准
|
||||
|
||||
root_dir = pathlib.Path(__file__).parent
|
||||
|
||||
print(f'rootdir: {rootdir}')
|
||||
working_dir = pathlib.Path.cwd()
|
||||
|
||||
config_var: ContextVar[ConfigFile] = ContextVar('config_var', default=ConfigFile(working_dir / "config" / "config.toml")) # 配置文件
|
||||
|
||||
print(f'workdir: {workdir}')
|
||||
try:
|
||||
config_var: ContextVar[ConfigFile] = ContextVar('config_var', default=ConfigFile(workdir / "config" / "config.toml")) # 配置文件
|
||||
except:
|
||||
print('加载用户配置失败')
|
||||
runtime_var: ContextVar = ContextVar('runtime_var', default=dict()) # 运行时共享数据
|
||||
|
||||
class ConfigContext:
|
||||
|
||||
@@ -27,5 +27,8 @@ class HeurAMSApp(App):
|
||||
def on_button_pressed(self, event: Button.Pressed) -> None:
|
||||
self.exit(event.button.id)
|
||||
|
||||
def environment_check():
|
||||
from heurams.context import working_var
|
||||
|
||||
app = HeurAMSApp()
|
||||
app.run()
|
||||
Reference in New Issue
Block a user