讲义生成.py的初始设定部分移到config.json
This commit is contained in:
parent
d904461d9b
commit
737ccad202
|
|
@ -32,7 +32,7 @@ def SetButton(string,openfilelist):
|
||||||
if not f in configjson:
|
if not f in configjson:
|
||||||
os.system("code -w "+f)
|
os.system("code -w "+f)
|
||||||
else:
|
else:
|
||||||
lineindex = getlineindex(f,"文本文件/config.json")
|
lineindex = getlineindex(f'"{f}"',"文本文件/config.json")
|
||||||
os.system(f"code -w -g 文本文件/config.json:{lineindex}")
|
os.system(f"code -w -g 文本文件/config.json:{lineindex}")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,10 @@
|
||||||
},
|
},
|
||||||
"pdf标题": "测试批量讲义",
|
"pdf标题": "测试批量讲义",
|
||||||
"提供答案": true
|
"提供答案": true
|
||||||
|
},
|
||||||
|
"讲义生成.py": {
|
||||||
|
"讲义标题格式": "V202503\\d{2}",
|
||||||
|
"输出路径": "临时文件",
|
||||||
|
"提供答案": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
16
工具v2/讲义生成.py
16
工具v2/讲义生成.py
|
|
@ -1,13 +1,17 @@
|
||||||
lessonpattern = r"U20240501" # 正则表达式, 数据库中讲义的编号([A-Z][0-9]{4}[(01)|(02)][[0-9]{2}), 字母表示类型, 四位数字表示届别, 2位数字表示学期及其他, 2位数字表示序号
|
# lessonpattern = r"U20240501" # 正则表达式, 数据库中讲义的编号([A-Z][0-9]{4}[(01)|(02)][[0-9]{2}), 字母表示类型, 四位数字表示届别, 2位数字表示学期及其他, 2位数字表示序号
|
||||||
outputdir = "d:/temp/26届材料" # 输出文件夹, 不建议修改
|
# outputdir = "d:/temp/26届材料" # 输出文件夹, 不建议修改
|
||||||
answered = True # 设置是否编译答案
|
# answered = True # 设置是否编译答案
|
||||||
|
|
||||||
|
|
||||||
jsonpath = "../备课组" #有json文件的根目录, 文件名需为"校本材料.json"
|
|
||||||
|
|
||||||
from database_tools import *
|
from database_tools import *
|
||||||
|
|
||||||
|
configjson = load_dict("文本文件/config.json")["讲义生成.py"]
|
||||||
|
|
||||||
|
lessonpattern = configjson["讲义标题格式"] # 正则表达式, 数据库中讲义的编号([A-Z][0-9]{4}[(01)|(02)][[0-9]{2}), 字母表示类型, 四位数字表示届别, 2位数字表示学期及其他, 2位数字表示序号
|
||||||
|
outputdir = configjson["输出路径"] # 输出文件夹, 不建议修改
|
||||||
|
answered = configjson["提供答案"] # 设置是否编译答案
|
||||||
|
|
||||||
|
|
||||||
|
jsonpath = "../备课组" #有json文件的根目录, 文件名需为"校本材料.json"
|
||||||
jsondicts = []
|
jsondicts = []
|
||||||
for loc,dirs,files in os.walk(jsonpath):
|
for loc,dirs,files in os.walk(jsonpath):
|
||||||
if "校本材料.json" in files:
|
if "校本材料.json" in files:
|
||||||
|
|
|
||||||
Reference in New Issue