20230405 night
This commit is contained in:
parent
955ed9ccfe
commit
eda2fe00da
|
|
@ -1,8 +1,8 @@
|
|||
import os,re,difflib,Levenshtein,time,json
|
||||
|
||||
# 重要!!! 新旧题目的范围(有重复默认为新题)
|
||||
id_new_problems = "40000:41000"
|
||||
id_old_problems = "30000:31000"
|
||||
id_new_problems = "30000:39999"
|
||||
id_old_problems = "1:50000"
|
||||
threshold = 0.99
|
||||
|
||||
#生成数码列表, 逗号分隔每个区块, 区块内部用:表示整数闭区间
|
||||
|
|
|
|||
21
工具/工具面板.py
21
工具/工具面板.py
|
|
@ -11,9 +11,19 @@ root.title('题库v2.0工具面板')
|
|||
def temp():
|
||||
pass
|
||||
|
||||
def SetButton(str,numbuttons,openfilelist):
|
||||
commandname.set(str)
|
||||
LabelTool.config(text = str)
|
||||
def generate_info(string):
|
||||
outputstring = "暂无信息"
|
||||
if string == "寻找空闲题号":
|
||||
outputstring = '功能: 在题库中列出所有空闲题号.\n1. 按"运行STEP1"按钮后等若干秒, 在终端查看结果.'
|
||||
elif string == "批量收录题目":
|
||||
outputstring = '功能: 在一个.tex文件中找到\\item开头的题目并收录到题库.\n'+'0. 选中菜单项后会打开一个编辑窗口, 在编辑窗口中设置\n\t(1) 初始编号;\n\t(2) 题目来源(文件中的%开头的注释行的内容会依次作为此后题目来源的后缀);\n\t(3) .tex文件名(完整路径);\n\t(4) 收录日期及编辑者;\n\t(5) 是否对题目进行编号.\n'+'1. 编辑完成后按"运行STEP1"按钮后等若干秒, 在终端查看结果.'
|
||||
return outputstring
|
||||
|
||||
|
||||
def SetButton(string,numbuttons,openfilelist):
|
||||
commandname.set(string)
|
||||
LabelTool.config(text = string)
|
||||
LabelInfo.config(text = generate_info(string))
|
||||
button1.place(x = 10, y = 10)
|
||||
button1.configure(bg = "green")
|
||||
if numbuttons == 1:
|
||||
|
|
@ -103,8 +113,10 @@ def run_command2():
|
|||
|
||||
commandname = StringVar()
|
||||
commandname.set("none")
|
||||
LabelTool = Label(root, text = "请在菜单栏选择工具", height = 1, width = 40, anchor=W)
|
||||
LabelTool = Label(root, text = "请在菜单栏选择工具", height = 1, width = 40, anchor=NW)
|
||||
LabelTool.place(x=10,y=100)
|
||||
LabelInfo = Label(root, text = "工具提示信息", height = 20, width = 100, anchor = NW, justify = "left")
|
||||
LabelInfo.place(x=10,y=140)
|
||||
|
||||
button1 = Button(root, text = "运行STEP1", command = run_command1)
|
||||
button2 = Button(root, text = "运行STEP2", command = run_command2)
|
||||
|
|
@ -186,5 +198,6 @@ menubar.add_command(label = "退出", command = root.destroy)
|
|||
|
||||
|
||||
root.config(menu = menubar)
|
||||
root.attributes("-topmost",1)
|
||||
|
||||
root.mainloop()
|
||||
|
|
@ -103,4 +103,4 @@ if not duplicate_flag:
|
|||
with open(r"../题库0.3/Problems.json","w",encoding = "utf8") as f:
|
||||
f.write(new_database)
|
||||
else:
|
||||
print("题号有重复, 请检查.\n"*5)
|
||||
print("题号有重复, 请检查.\n"*5+'\n'+"未录入新题目\n"*5)
|
||||
|
|
@ -314464,7 +314464,9 @@
|
|||
"edit": [
|
||||
"20221215\t王伟叶"
|
||||
],
|
||||
"same": [],
|
||||
"same": [
|
||||
"040565"
|
||||
],
|
||||
"related": [],
|
||||
"remark": "",
|
||||
"space": ""
|
||||
|
|
@ -441580,7 +441582,9 @@
|
|||
"edit": [
|
||||
"20230108\t王伟叶"
|
||||
],
|
||||
"same": [],
|
||||
"same": [
|
||||
"040017"
|
||||
],
|
||||
"related": [],
|
||||
"remark": "",
|
||||
"space": "12ex"
|
||||
|
|
@ -448825,7 +448829,9 @@
|
|||
"edit": [
|
||||
"20230218\t王伟叶"
|
||||
],
|
||||
"same": [],
|
||||
"same": [
|
||||
"031130"
|
||||
],
|
||||
"related": [],
|
||||
"remark": "",
|
||||
"space": "12ex"
|
||||
|
|
@ -459387,7 +459393,9 @@
|
|||
"edit": [
|
||||
"20230405\t王伟叶"
|
||||
],
|
||||
"same": [],
|
||||
"same": [
|
||||
"012643"
|
||||
],
|
||||
"related": [],
|
||||
"remark": "",
|
||||
"space": ""
|
||||
|
|
|
|||
Reference in New Issue