-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScript.py
34 lines (28 loc) · 891 Bytes
/
Script.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
import csv
import os
map = {}
with open('methods.csv', newline='') as csvfile:
csvReader = csv.reader(csvfile, delimiter=',')
for row in csvReader:
map[row[0]] = row[1]
with open('params.csv', newline='') as csvfile:
csvReader = csv.reader(csvfile, delimiter=',')
for row in csvReader:
map[row[0]] = row[1]
with open('fields.csv', newline='') as csvfile:
csvReader = csv.reader(csvfile, delimiter=',')
for row in csvReader:
map[row[0]] = row[1]
print("Remapping...")
for subdir, dirs, files in os.walk('./'):
for file in files:
if file.endswith(".java"):
f = open(file, "rt")
data = f.read()
for a,b in map.items():
data = data.replace(a, b)
f.close()
f = open(file, "wt")
f.write(data)
f.close
print("Finished!")