网页获取讲义的路径改变

This commit is contained in:
weiye.wang 2024-06-23 07:52:11 +08:00
parent 16111a5bdd
commit 498a57e173
1 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ def index():
# obj_dict = load_dict("../题库0.3/LessonObj.json") # obj_dict = load_dict("../题库0.3/LessonObj.json")
# basicknowledge_dict = load_dict("../题库0.3/BasicKnowledge.json") # basicknowledge_dict = load_dict("../题库0.3/BasicKnowledge.json")
consecutivenumbering = structure_dict[papertype]["consecutivenumbering"] consecutivenumbering = structure_dict[papertype]["consecutivenumbering"]
texdata = GenerateSingleLessonNotefromMariaDB(mycursor,pid,structure_dict,notes_dict,"../工具v4/模板文件/讲义模板.txt",os.path.join(outputpath,filename),configjson,consecutivenumbering) #20240415版讲义生成 texdata = GenerateSingleLessonNotefromMariaDB(mycursor,pid,structure_dict,notes_dict,"./模板文件/讲义模板.txt",os.path.join(outputpath,filename),configjson,consecutivenumbering) #20240415版讲义生成
mydb.close() mydb.close()
return f''' return f'''
<h1>{pid} PDF 文件生成完毕</h1> <h1>{pid} PDF 文件生成完毕</h1>
@ -122,7 +122,7 @@ def index():
for singleid in problems_list: for singleid in problems_list:
bodystring += generateLaTeXBodyContentfromMariaDB(mycursor,singleid,configjson) + "\n" bodystring += generateLaTeXBodyContentfromMariaDB(mycursor,singleid,configjson) + "\n"
bodystring += "\\end{enumerate}\n\n" bodystring += "\\end{enumerate}\n\n"
templatepath = "../工具v4/模板文件/讲义模板.txt" templatepath = "./模板文件/讲义模板.txt"
outputfilepath = os.path.join(outputpath,filename) outputfilepath = os.path.join(outputpath,filename)
texdata = ReadTextFile(templatepath) texdata = ReadTextFile(templatepath)
texdata = StringSubstitute(r"<<[\s\S]*?待替换[\s\S]*?>>",texdata,("选题编译",bodystring)) texdata = StringSubstitute(r"<<[\s\S]*?待替换[\s\S]*?>>",texdata,("选题编译",bodystring))