-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathto_zoia.py
43 lines (35 loc) · 1.06 KB
/
to_zoia.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
import csv
import glob
import os
import re
from shutil import copyfile
import os.path
from mdutils.mdutils import MdUtils
path = os.getcwd()
print("The current working directory is %s" % path)
default = {}
for i in range(0, 64):
default[i] = [
f'./patches/blank/_zoia.bin',
f'./to_zoia/{i:03d}_zoia_blank.bin'
]
files = glob.glob('./to_zoia/**/*.bin', recursive=True)
for f in files:
try:
os.remove(f)
except OSError as e:
print("Error: %s : %s" % (f, e.strerror))
with open('./to_zoia_patches.csv', newline='') as csvfile:
patches = csv.DictReader(csvfile, delimiter=',', quotechar='"')
for row in patches:
patchNumber = int(row["patchNumber"])
patchName = row["patchName"]
source = f'./patches/{patchName}/_zoia.bin'
default[patchNumber] = [
source,
f'./to_zoia/{patchNumber:03d}_zoia_{patchName}.bin'
]
for key, value in default.items():
print(key, '->', value[0], value[1])
if(os.path.isfile(value[0])):
copyfile(value[0], value[1])