-
Notifications
You must be signed in to change notification settings - Fork 9
/
compiler.py
27 lines (21 loc) · 938 Bytes
/
compiler.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
import py_compile, zipfile, os, glob
WOTVersion = "0.9.0"
# Compile Source
py_compile.compile("src/currentvehicle.py")
# Build Standalone Zip
if os.path.exists("XVMTankRange.zip"):
os.remove("XVMTankRange.zip")
fZip = zipfile.ZipFile( "XVMTankRange.zip", "w" )
fZip.write("src/currentvehicle.pyc", "res_mods/"+WOTVersion+"/scripts/client/currentvehicle.pyc")
fZip.write("data/tankrange.xc", "res_mods/xvm/tankrange.xc")
fZip.close()
# Build XVM Zip
if os.path.exists("XVMTankRange-WithXVM.zip"):
os.remove("XVMTankRange-WithXVM.zip")
fZip = zipfile.ZipFile( "XVMTankRange-WithXVM.zip", "w" )
fZip.write("src/currentvehicle.pyc", "res_mods/"+WOTVersion+"/scripts/client/currentvehicle.pyc")
fZip.write("data/tankrange.xc", "res_mods/xvm/tankrange.xc")
for root, dirnames, filenames in os.walk('xvm'):
for filename in filenames:
fZip.write(os.path.join(root, filename), "res_mods/"+os.path.join(root, filename)[4:])
fZip.close()