分析工具支持修改上下限时重绘图像
This commit is contained in:
@@ -325,5 +325,52 @@ class sch_data(object):
|
||||
save_f.write(json_str.encode("utf-8"))
|
||||
save_f.close()
|
||||
print("scheme export end.")
|
||||
|
||||
|
||||
|
||||
|
||||
# 显示所有方案文件的方案id
|
||||
|
||||
|
||||
# 找到指定后缀的文件
|
||||
def find_type(path:str,fix:str):
|
||||
# path = os.getcwd()
|
||||
# print("path",path)
|
||||
list=os.listdir(path)
|
||||
# print("list",list)
|
||||
file_list=[]
|
||||
for i in list:
|
||||
ps=os.path.join(path, i)
|
||||
if os.path.isdir(ps):
|
||||
# print("path join",ps)
|
||||
file_list+=find_type(ps,fix)
|
||||
else:
|
||||
if(ps[-len(fix):]==fix):
|
||||
file_list.append(ps)
|
||||
# print("file_list", file_list)
|
||||
return file_list
|
||||
|
||||
|
||||
|
||||
def show_scheme_id(file_list):
|
||||
id_list=[]
|
||||
for i in file_list:
|
||||
with open(i,"rb") as f:
|
||||
json_obj=json.loads(f.read())
|
||||
try:
|
||||
id_list.append((i,json_obj["PlanID"]))
|
||||
except Exception as e:
|
||||
id_list.append((i,0))
|
||||
return id_list
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
_main()
|
||||
# _main()
|
||||
file_list=find_type('./','.json')
|
||||
id_list=show_scheme_id(file_list)
|
||||
for i in id_list:
|
||||
print(i[1],i[0])
|
||||
|
Reference in New Issue
Block a user