Resource information is now centralized in resources.csv.

The old scripts that trolled content/ and src/ for information
have been retired, and the new script reads the CSV file and
generates the resource files directly.

Future changes to the resource indices or content should be
done by modifying resources.csv and regenerating the data.


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2925 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2008-02-24 22:06:03 +00:00
parent 9d914998b9
commit d0dcf67ac6
10 changed files with 148 additions and 19 deletions
+46
View File
@@ -0,0 +1,46 @@
#!/usr/bin/python
import sys
import os
import os.path
import explorer
import mastermap
import relst
if len(sys.argv) < 2:
basedir = os.path.join(os.path.pardir, os.path.pardir, "sc2", "content")
else:
basedir = sys.argv[1]
verbose = True
def deploy_map():
target = os.path.join(basedir, "uqm.rmp")
outfile = file(target, 'wt')
if verbose:
print "Writing %s..." % target
for l in mastermap.create_map(basedir):
print>>outfile, l
outfile.close()
def deploy_ls2(name, pkg):
newpkg = os.path.splitext(name)[0]+'.ls2'
newvals = relst.process(pkg)
outfile = file(newpkg, 'wt')
print "Writing %s..." % newpkg
for l in newvals:
print>>outfile, l
outfile.close()
def deploy_ls2s():
pkgnames = explorer.get_lists(basedir)
packages = [(x, explorer.read_list(x)) for x in pkgnames]
for (name, pkg) in packages:
deploy_ls2(name, pkg)
if __name__ == '__main__':
deploy_map()
deploy_ls2s()