Added aqua_speed for rite geo 50 tryker
[ryzomcore.git] / nel / tools / build_gamedata / processes / 0_setup.py
blob01eab610244652736c87b166a4f1b6cee764731d
1 #!/usr/bin/python
2 #
3 # \file 0_setup.py
4 # \brief Run all setup processes
5 # \date 2009-02-18 15:28GMT
6 # \author Jan Boon (Kaetemi)
7 # Python port of game data build pipeline.
8 # Run all setup processes
9 #
10 # NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
11 # Copyright (C) 2009-2014 by authors
13 # This program is free software: you can redistribute it and/or modify
14 # it under the terms of the GNU Affero General Public License as
15 # published by the Free Software Foundation, either version 3 of the
16 # License, or (at your option) any later version.
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU Affero General Public License for more details.
23 # You should have received a copy of the GNU Affero General Public License
24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
27 import time, sys, os, shutil, subprocess, distutils.dir_util, argparse
28 sys.path.append("../configuration")
30 parser = argparse.ArgumentParser()
31 parser.add_argument('--includeprocess', '-ipc', nargs='+')
32 parser.add_argument('--excludeprocess', '-epc', nargs='+')
33 args = parser.parse_args()
35 if os.path.isfile("log.log"):
36 os.remove("log.log")
37 log = open("log.log", "w")
38 from scripts import *
39 from buildsite import *
40 from process import *
41 from tools import *
42 from directories import *
44 #printLog(log, "")
45 #printLog(log, "-------")
46 #printLog(log, "--- Setup project")
47 #printLog(log, "-------")
48 #printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time())))
49 #printLog(log, "")
51 #printLog(log, "")
52 #printLog(log, "-------")
53 #printLog(log, "--- Setup client directories")
54 #printLog(log, "-------")
55 #printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time())))
56 #printLog(log, "")
57 #for dir in ClientSetupDirectories:
58 # mkPath(log, InstallDirectory + "/" + dir)
59 #printLog(log, "")
61 printLog(log, "")
62 printLog(log, "-------")
63 printLog(log, "--- Run the setup processes")
64 printLog(log, "-------")
65 printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time())))
66 printLog(log, "")
67 # For each process
68 for processName in ProcessToComplete:
69 if ((args.includeprocess == None or processName in args.includeprocess) and (args.excludeprocess == None or not processName in args.excludeprocess)):
70 printLog(log, "PROCESS " + processName)
71 os.chdir(processName)
72 try:
73 subprocess.call([ "python", "0_setup.py" ])
74 except Exception, e:
75 printLog(log, "<" + processName + "> " + str(e))
76 os.chdir("..")
77 try:
78 processLog = open(processName + "/log.log", "r")
79 processLogData = processLog.read()
80 processLog.close()
81 log.write(processLogData)
82 except Exception, e:
83 printLog(log, "<" + processName + "> " + str(e))
84 # subprocess.call("idle.bat")
85 else:
86 printLog(log, "IGNORE PROCESS " + processName)
87 printLog(log, "")
89 log.close()