26 lines
1014 B
Python
26 lines
1014 B
Python
import sys,json,re
|
|
sys.stdout.reconfigure(encoding='utf-8')
|
|
sys.path.insert(0,r'C:\Aislo_wt\sub_laptop_2\tmp\M01_고침\sub2')
|
|
import tool
|
|
cm=tool.cm; mf=cm.mf
|
|
keys=[]
|
|
for l in open('C:/Aislo_wt/sub_laptop_2/tmp/M01_고침/sub2/changes.txt',encoding='utf-8'):
|
|
m=re.match(r'(G[CF]\d{6})\[',l)
|
|
if m and m.group(1) not in keys: keys.append(m.group(1))
|
|
whole=cm.master(); files=cm.load()
|
|
rows={}
|
|
for d in files.values():
|
|
if d.get('그룹')=='로직':
|
|
for r in d['줄']: rows[str(r['키'])]=r
|
|
ok=0; bad=[]
|
|
for k in keys:
|
|
r=rows[k]
|
|
try:
|
|
res=mf.run(whole,k,cm.시험입력(r))
|
|
warns=[ (x.get('이름'),x.get('단위경고')) for x in res['줄'] if x.get('단위경고')]
|
|
print(k,r['이름'][:20],'계',format(res['계'],'.2f') if not isinstance(res['계'],str) else res['계'],'경고',len(warns),warns[:3])
|
|
ok+=1
|
|
except Exception as e:
|
|
bad.append((k,str(e)[:160])); print(k,'멈춤',str(e)[:160])
|
|
print('통과',ok,'멈춤',len(bad),'/',len(keys))
|