提交 b260486a 编写于 作者: F feilong

fix bug

上级 62ae00ab
import os
from .tree import load_json, dump_json
def init_dir(tree_name):
tree = load_json('data/tree_simple.json')
level_0 = tree['level']['level_0']
level_1 = tree['level']['level_1']
level_2 = tree['level']['level_2']
tree = tree['tree']
init_level(tree, level_0, f'data/1.{tree_name}初阶')
init_level(tree, level_1, f'data/2.{tree_name}中阶')
init_level(tree, level_2, f'data/3.{tree_name}高阶')
def init_level(tree, level, root):
chapter_i = 1
for chapter in level:
sections = tree[chapter]
chapter_dir = os.path.join(root, f'{chapter_i}.{chapter}')
os.makedirs(chapter_dir, exist_ok=True)
section_i = 1
for section in sections:
section_dir = os.path.join(chapter_dir, f'{section_i}.{section}')
os.makedirs(section_dir, exist_ok=True)
section_i += 1
chapter_i += 1
......@@ -521,7 +521,7 @@ class TreeWalker:
with open('requirements.txt', 'w', encoding='utf-8') as f:
f.write('\n'.join([
".pre_commit",
"pre_commit",
"skill-tree-parser",
]))
......@@ -659,6 +659,7 @@ class TreeWalker:
f'* 合成过程中,会自动检查每个知识点目录下 `config.json` 里的 `export` 里导出的习题配置,检查是否存在`exercise_id` 字段,如果不存在则生成',
f'* 在 节 目录下根据需要,可以添加一些子目录用来测试代码。',
f'* 开始游戏入门技能树构建之旅,GoodLuck! ',
f'',
f'## FAQ',
f'',
f'**难度目录是固定的么?**',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册