-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidate.py
executable file
·49 lines (36 loc) · 1.46 KB
/
validate.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
43
44
45
46
47
#!/usr/bin/python
# bethesda files
morrowind_md5 = None
with open("copyright/morrowind.md5", 'r') as content_file:
morrowind_md5 = content_file.read()
tribunal_md5 = None
with open("copyright/tribunal.md5", 'r') as content_file:
tribunal_md5 = content_file.read()
bloodmoon_md5 = None
with open("copyright/bloodmoon.md5", 'r') as content_file:
bloodmoon_md5 = content_file.read()
def validate(md5_list, version):
print "\nComparing md5sum of AoA version %s to the contents Bethesda's BSA files." % version
beth_counter = 0
for line in md5_list.split('\n'):
if len(line) > 0:
md5, file_name = line.split(" ")
if md5 in morrowind_md5:
beth_counter += 1
print "Found in Morrowind.bsa", md5, file_name
if md5 in tribunal_md5:
beth_counter += 1
print "Found in Tribunal.bsa", md5, file_name
if md5 in bloodmoon_md5:
beth_counter += 1
print "Found in Bloodmoon.bsa", md5, file_name
print "Out of %d files, found %d bethesda files.\n" % (len(md5_list.split('\n'))-1, beth_counter)
# aoa files
aoav10_md5 = None
with open("manifest/aoav10.md5", 'r') as content_file:
aoav10_md5 = content_file.read()
validate(aoav10_md5, "1.0")
aoav11_md5 = None
with open("manifest/aoav11.md5", 'r') as content_file:
aoav11_md5 = content_file.read()
validate(aoav11_md5, "1.1")