From 1f731ec78864041b65b58665f4dc79dd3eb8e5d1 Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Fri, 30 Jun 2023 20:42:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E5=8E=BBdatabase=5Ftools=E4=B8=AD?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=97=A0=E7=94=A8=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v2/database_tools.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/工具v2/database_tools.py b/工具v2/database_tools.py index 7da78ca0..c8e03504 100644 --- a/工具v2/database_tools.py +++ b/工具v2/database_tools.py @@ -148,21 +148,6 @@ def spareIDs(dictname): #返回空闲题号 output += "首个空闲id: %s, 直至: %s"%(str(int(used_list[-1][-6:])+1).zfill(6),"999999") return output #返回的是一个多行的字符串, 每一行中含有一个空闲题号的闭区间 -def parse_usage(datastring): #对单个usages中的项的结果进行分词 - datastring = re.sub(r"\s+","\t",datastring.strip()) - datalist = datastring.split("\t") - date = "" - classname = "" - diff = [] - for item in datalist: - if not "." in item and not "高" in item and not "班" in item: - date = item - elif "高" in item or "班" in item: - classname = item - else: - diff.append(item) - return({"date":date,"classname":classname,"difficulty":diff}) #返回一个字典, "date"表示日期, "classname"表示班级, "difficultiy"表示难度列表 - def GenerateProblemListFromString(data): #从来自.tex文件的字符串生成题目列表, 每个item是一道题目, 新一行的%用作前缀 try: