-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEvalDiffReport.py
42 lines (37 loc) · 1.1 KB
/
EvalDiffReport.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python3
# Mission: Show what has changed between .eval files.
def report(a_list, a_mod):
for ss, item in enumerate(a_list,1):
disp = chr(0x25b7)
if item in covered:
disp = chr(0x25b6)
print(f"{disp:<2}{item:<13}", end='')
if ss % a_mod == 0:
print()
print()
import os
items = {}
for item in os.listdir():
if not item.endswith('.eval'):
continue
with open(item) as fh:
items[item] = set(eval(fh.read()))
gotcha = []
for ka in items:
for kb in items:
if ka is kb:
continue
print(ka, kb, sep = ' ~v~ ')
difa = items[ka] - items[kb]
difb = items[kb] - items[ka]
if difa == difb:
gotcha.append(difa)
print('\t',difa)
else:
a_union = difa.union(difb)
if a_union in gotcha:
print('\tmeh... ')
gotcha.append(a_union)
for ss, line in enumerate(sorted(a_union), 1):
print(f'\t{ss}.) {line}')
print()