forked from JDongian/bwapi3to4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconvert.py
More file actions
executable file
·36 lines (24 loc) · 717 Bytes
/
convert.py
File metadata and controls
executable file
·36 lines (24 loc) · 717 Bytes
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
#!/usr/bin/python3
import os
from changes import *
BOT_DIR = "bot_sources"
DEFAULT_BOT = "ualberta"
def get_source_files(bot_name):
source_files = []
for root, dirs, files in os.walk("./{}/{}".format(BOT_DIR, DEFAULT_BOT)):
for f in files:
if f.endswith(".cpp"):
source_files.append(os.path.join(root, f))
return source_files
def convert(source):
return source
if __name__ == "__main__":
bot = DEFAULT_BOT
#bot = input("Bot to convert: ")
files = get_source_files(DEFAULT_BOT)
for filename in files[:2]:
old = None
with open(filename, 'r') as fp:
old = fp.read()
new = convert(old)
print(new)