fix: 改进
This commit is contained in:
@@ -10,14 +10,16 @@ from heurams.services.config import ConfigFile
|
||||
# 用户配置文件路径规定: 以运行目录为准
|
||||
# 数据文件路径规定: 以运行目录为准
|
||||
|
||||
root_dir = pathlib.Path(__file__).parent
|
||||
rootdir = pathlib.Path(__file__).parent
|
||||
print(f'rootdir: {rootdir}')
|
||||
working_dir = pathlib.Path.cwd()
|
||||
workdir = pathlib.Path.cwd()
|
||||
print(f'workdir: {workdir}')
|
||||
config_var: ContextVar[ConfigFile] = ContextVar('config_var', default=ConfigFile(rootdir / "default" / "config" / "config.toml"))
|
||||
try:
|
||||
config_var: ContextVar[ConfigFile] = ContextVar('config_var', default=ConfigFile(workdir / "config" / "config.toml")) # 配置文件
|
||||
print('已加载自定义用户配置')
|
||||
except:
|
||||
print('加载用户配置失败')
|
||||
print('未能加载自定义用户配置')
|
||||
runtime_var: ContextVar = ContextVar('runtime_var', default=dict()) # 运行时共享数据
|
||||
|
||||
class ConfigContext:
|
||||
|
||||
29
src/heurams/default/config/config.toml
Normal file
29
src/heurams/default/config/config.toml
Normal file
@@ -0,0 +1,29 @@
|
||||
# [调试] 将更改保存到文件
|
||||
persist_to_file = 1
|
||||
|
||||
# [调试] 覆写时间, 设为 -1 以禁用
|
||||
daystamp_override = -1
|
||||
timestamp_override = -1
|
||||
|
||||
# [调试] 一键通过
|
||||
quick_pass = 0
|
||||
|
||||
# 对于每个项目的默认新记忆原子数量
|
||||
tasked_number = 8
|
||||
|
||||
# UTC 时间戳修正 仅用于 UNIX 日时间戳的生成修正, 单位为秒
|
||||
timezone_offset = +28800 # 中国标准时间 (UTC+8)
|
||||
|
||||
[puzzles] # 谜题默认配置
|
||||
|
||||
[puzzles.mcq]
|
||||
max_riddles_num = 2
|
||||
|
||||
[puzzles.cloze]
|
||||
min_denominator = 3
|
||||
|
||||
[paths] # 相对于配置文件的 ".." (即工作目录) 而言 或绝对路径
|
||||
nucleon_dir = "./data/nucleon"
|
||||
electron_dir = "./data/electron"
|
||||
orbital_dir = "./data/orbital"
|
||||
cache_dir = "./data/cache"
|
||||
Reference in New Issue
Block a user