From 481910f1e45d0128c8f2ed7b2f84f69385a142c0 Mon Sep 17 00:00:00 2001 From: Mars Liu Date: Fri, 3 Dec 2021 15:53:27 +0800 Subject: [PATCH] add export missed --- .../config.json" | 11 +++++++++-- .../config.json" | 9 +++++++-- .../config.json" | 9 +++++++-- .../5.CTE/config.json" | 10 ++++++++-- .../3.fdw/config.json" | 9 +++++++-- src/tree.py | 12 +++++++++++- 6 files changed, 49 insertions(+), 11 deletions(-) diff --git "a/data/2.PostgreSQL\344\270\255\351\230\266/1.PostgreSQL\346\225\260\346\215\256\345\272\223\347\232\204\345\237\272\346\234\254\347\273\223\346\236\204/6.\346\225\260\346\215\256\345\272\223\346\211\251\345\261\225/config.json" "b/data/2.PostgreSQL\344\270\255\351\230\266/1.PostgreSQL\346\225\260\346\215\256\345\272\223\347\232\204\345\237\272\346\234\254\347\273\223\346\236\204/6.\346\225\260\346\215\256\345\272\223\346\211\251\345\261\225/config.json" index fb9d9e3..05176be 100644 --- "a/data/2.PostgreSQL\344\270\255\351\230\266/1.PostgreSQL\346\225\260\346\215\256\345\272\223\347\232\204\345\237\272\346\234\254\347\273\223\346\236\204/6.\346\225\260\346\215\256\345\272\223\346\211\251\345\261\225/config.json" +++ "b/data/2.PostgreSQL\344\270\255\351\230\266/1.PostgreSQL\346\225\260\346\215\256\345\272\223\347\232\204\345\237\272\346\234\254\347\273\223\346\236\204/6.\346\225\260\346\215\256\345\272\223\346\211\251\345\261\225/config.json" @@ -1,6 +1,13 @@ { "node_id": "pg-d2b6e840cfad44a2aa357cfee56d437d", - "keywords": ["数据库扩展", "数据库插件", "extension"], + "keywords": [ + "数据库扩展", + "数据库插件", + "extension" + ], "children": [], - "export": [] + "export": [ + "language.json", + "extension.json" + ] } \ No newline at end of file diff --git "a/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/1.\350\201\232\345\220\210\345\222\214\345\210\206\347\273\204/config.json" "b/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/1.\350\201\232\345\220\210\345\222\214\345\210\206\347\273\204/config.json" index 7d7c586..d23aa9c 100644 --- "a/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/1.\350\201\232\345\220\210\345\222\214\345\210\206\347\273\204/config.json" +++ "b/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/1.\350\201\232\345\220\210\345\222\214\345\210\206\347\273\204/config.json" @@ -1,6 +1,11 @@ { "node_id": "pg-3a87b0dbead643e58f1ff1d93acd80cc", - "keywords": ["group by", "分组"], + "keywords": [ + "group by", + "分组" + ], "children": [], - "export": [] + "export": [ + "salary.json" + ] } \ No newline at end of file diff --git "a/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/2.\350\277\236\346\216\245\346\237\245\350\257\242/config.json" "b/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/2.\350\277\236\346\216\245\346\237\245\350\257\242/config.json" index 26d2258..5a941b6 100644 --- "a/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/2.\350\277\236\346\216\245\346\237\245\350\257\242/config.json" +++ "b/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/2.\350\277\236\346\216\245\346\237\245\350\257\242/config.json" @@ -1,6 +1,11 @@ { "node_id": "pg-458d5d590ea64188847b45d8e6343f83", - "keywords": ["join", "连接查询"], + "keywords": [ + "join", + "连接查询" + ], "children": [], - "export": [] + "export": [ + "customer_order.json" + ] } \ No newline at end of file diff --git "a/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/5.CTE/config.json" "b/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/5.CTE/config.json" index 146c831..c916f50 100644 --- "a/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/5.CTE/config.json" +++ "b/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/5.CTE/config.json" @@ -1,6 +1,12 @@ { "node_id": "pg-6beb084543204f4f9d87930c0a6c5707", - "keywords": ["common table expression", "cte", "recursive"], + "keywords": [ + "common table expression", + "cte", + "recursive" + ], "children": [], - "export": [] + "export": [ + "to_root.json" + ] } \ No newline at end of file diff --git "a/data/3.PostgreSQL\351\253\230\351\230\266/1.\351\233\206\347\276\244\345\222\214\345\244\215\345\210\266/3.fdw/config.json" "b/data/3.PostgreSQL\351\253\230\351\230\266/1.\351\233\206\347\276\244\345\222\214\345\244\215\345\210\266/3.fdw/config.json" index 688ad40..f668756 100644 --- "a/data/3.PostgreSQL\351\253\230\351\230\266/1.\351\233\206\347\276\244\345\222\214\345\244\215\345\210\266/3.fdw/config.json" +++ "b/data/3.PostgreSQL\351\253\230\351\230\266/1.\351\233\206\347\276\244\345\222\214\345\244\215\345\210\266/3.fdw/config.json" @@ -1,6 +1,11 @@ { "node_id": "pg-20a433f6ae65429f9b1a7f17c751ac01", - "keywords": ["外部数据连接", "fdw"], + "keywords": [ + "外部数据连接", + "fdw" + ], "children": [], - "export": [] + "export": [ + "fdw.json" + ] } \ No newline at end of file diff --git a/src/tree.py b/src/tree.py index ae5c7e5..b5a8cb2 100644 --- a/src/tree.py +++ b/src/tree.py @@ -306,13 +306,23 @@ class TreeWalker: def ensure_exercises(self, section_path): config = self.ensure_section_config(section_path) + flag = False for e in os.listdir(section_path): base, ext = os.path.splitext(e) _, source = os.path.split(e) if ext != ".md": continue - meta_path = os.path.join(section_path, base + ".json") + mfile = base + ".json" + meta_path = os.path.join(section_path, mfile) self.ensure_exercises_meta(meta_path, source) + export = config.get("export", []) + if mfile not in export: + export.append(mfile) + flag = True + config["export"] = export + + if flag: + dump_json(os.path.join(section_path, "config.json"), config, True, True) for e in config.get("export", []): full_name = os.path.join(section_path, e) -- GitLab