提交 24901b35 编写于 作者: M Mars Liu

fixed odd orders

上级 38ab8f7a
......@@ -326,8 +326,12 @@ class TreeWalker:
def ensure_exercises_meta(self, meta_path, source):
_, mfile = os.path.split(meta_path)
meta = None
if os.path.exists(meta_path):
meta = load_json(meta_path)
with open(meta_path) as f:
content = f.read()
if content:
meta = json.loads(content)
if "exercise_id" not in meta:
meta["exercise_id"] = uuid.uuid4().hex
if "notebook_enable" not in meta:
......@@ -338,7 +342,7 @@ class TreeWalker:
meta["author"] = user_name()
if "type" not in meta:
meta["type"] = "code_options"
else:
if meta is None:
meta = {
"type": "code_options",
"author": user_name(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册