-
Notifications
You must be signed in to change notification settings - Fork 1
/
ladder_zip.py
55 lines (43 loc) · 1.57 KB
/
ladder_zip.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
48
49
50
51
52
53
54
55
# Script for creating Ladder Manager compatible Zip archives.
import argparse
import os
from bot_loader import LadderZip
# import sub_module # Important, do not remove!
from version import update_version_txt
root_dir = os.path.dirname(os.path.abspath(__file__))
# Files or folders common to all bots.
common = [
(os.path.join("sharpy-sc2", "jsonpickle"), "jsonpickle"),
(os.path.join("sharpy-sc2", "sharpy"), "sharpy"),
(os.path.join("sharpy-sc2", "python-sc2", "sc2"), "sc2"),
(os.path.join("sharpy-sc2", "sc2pathlib"), "sc2pathlib"),
(os.path.join("sharpy-sc2", "config.py"), "config.py"),
(os.path.join("sharpy-sc2", "ladder.py"), "ladder.py"),
("requirements.txt", None),
("version.txt", None),
("config.ini", None),
("ladderbots.json", None),
]
# Files or folders to be ignored from the archive.
ignored = [
"__pycache__",
]
ladder_zip = LadderZip(
"Chance", "Random", [
("chance", None),
(os.path.join("bossman-sc2", "bossman"), "bossman"),
(os.path.join("queens-sc2", "queens_sc2"), "queens_sc2"),
("run.py", None),
(os.path.join("SC2MapAnalysis", "MapAnalyzer"), "MapAnalyzer"),
], common
)
def main():
parser = argparse.ArgumentParser(
description="Create a Ladder Manager ready zip archive for SC2 AI, AI Arena, Probots, ..."
)
parser.add_argument("-e", "--exe", help="Also make executable (Requires pyinstaller)", action="store_true")
args = parser.parse_args()
update_version_txt()
ladder_zip.create_ladder_zip(args.exe)
if __name__ == "__main__":
main()