Linux multi-monitor fullscreen support
[ryzomcore.git] / nel / tools / build_gamedata / processes / farbank / 2_build.py
blob85008bddea5e50e8523bb46744bfec01d7f2aaad
1 #!/usr/bin/python
2 #
3 # \file 2_build.py
4 # \brief Build farbank
5 # \date 2009-03-10-21-12-GMT
6 # \author Jan Boon (Kaetemi)
7 # Python port of game data build pipeline.
8 # Build farbank
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
28 sys.path.append("../../configuration")
30 if os.path.isfile("log.log"):
31 os.remove("log.log")
32 log = open("log.log", "w")
33 from scripts import *
34 from buildsite import *
35 from process import *
36 from tools import *
37 from directories import *
39 printLog(log, "")
40 printLog(log, "-------")
41 printLog(log, "--- Build farbank")
42 printLog(log, "-------")
43 printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time())))
44 printLog(log, "")
46 # Find tools
47 ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix)
48 BuildFarbank = findTool(log, ToolDirectories, BuildFarbankTool, ToolSuffix)
49 printLog(log, "")
51 # For each bank export farbank
52 printLog(log, ">>> Build farbank <<<")
53 if ExecTimeout == "":
54 toolLogFail(log, ExecTimeoutTool, ToolSuffix)
55 elif BuildFarbank == "":
56 toolLogFail(log, BuildFarbankTool, ToolSuffix)
57 else:
58 mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory)
59 mkPath(log, ExportBuildDirectory + "/" + FarbankBuildDirectory)
60 files = findFiles(log, ExportBuildDirectory + "/" + SmallbankExportDirectory, "", ".smallbank")
61 for file in files:
62 sourceFile = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + file
63 if os.path.isfile(sourceFile):
64 for postfix in MultipleTilesPostfix:
65 destFile = ExportBuildDirectory + "/" + FarbankBuildDirectory + "/" + file[0:-len(".smallbank")] + postfix + ".farbank"
66 if (needUpdateLogRemoveDest(log, sourceFile, destFile)):
67 mkPath(log, DatabaseDirectory + "/" + TileRootSourceDirectory + postfix)
68 subprocess.call([ ExecTimeout, str(FarbankBuildTimeout), BuildFarbank, sourceFile, destFile, "-d" + DatabaseDirectory + "/" + TileRootSourceDirectory + postfix + "/", "-p" + postfix ])
69 printLog(log, "")
71 log.close()
74 # end of file