-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildViewer.py
54 lines (40 loc) · 1.67 KB
/
BuildViewer.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
#!/usr/bin/env python
"""
A simple script that copies all the cubes and everything into the right places
This has not been well set up to work universally. It's only been tested on one setup
"""
import os, shutil
from TAP_Setup import setup
TAPViewerDir = os.path.join(setup.RootDir, setup.TAPViewerPath)
#Check if TAP Viewer Dir exists:
if not os.path.isdir(TAPViewerDir):
print "making new TAP Viewer Directory"
os.mkdir(TAPViewerDir)
# copy the exe
# shutil.copy(os.path.join(setup.TAPViewerSource, "TAP.exe"), TAPViewerDir)
# Check for TAPDATA
TAPDATADir = os.path.join(TAPViewerDir,"TAPDATA")
if not os.path.isdir(TAPDATADir):
print "Making TAPDATA Directory"
os.mkdir(TAPDATADir)
# copy the TAPCONFIG file
shutil.copy(os.path.join(setup.TAPViewerSource, "TAPCONFIG.txt"), TAPDATADir)
# copy the site.txt file
shutil.copy(os.path.join(setup.RootDir,"site.txt"), TAPDATADir)
shutil.copy(os.path.join(setup.TAPViewerSource, setup.MapFileName), TAPDATADir)
# copy the start times file (not required, but it's good to have it there
print setup.StartTimeFiles
for (filename, _) in setup.StartTimeFiles:
shutil.copy(filename, TAPDATADir)
FullCubesPath = os.path.join(setup.RootDir, setup.CubesPath)
for (season, junk) in setup.Seasons:
SeasonPath = os.path.join(TAPDATADir,season)
if not os.path.isdir(SeasonPath):
print "Creating:", SeasonPath
os.mkdir(SeasonPath)
SeasonCubesPath = os.path.join(FullCubesPath,season)
print SeasonPath, SeasonCubesPath
for name in os.listdir(SeasonCubesPath):
print "Moving:", name
shutil.move(os.path.join(SeasonCubesPath,name),
os.path.join(SeasonPath,name) )