d0dcf67ac6
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
36 lines
832 B
Python
Executable File
36 lines
832 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
import sys
|
|
import os
|
|
import os.path
|
|
import explorer
|
|
import stridgen
|
|
|
|
def process (res):
|
|
result = []
|
|
for ((a, b, c), d) in res:
|
|
mapline = stridgen.makeid(d)
|
|
if mapline is None:
|
|
mapline = "ERROR"
|
|
result.append("%3d %3d %3d %s" % (a, b, c, mapline))
|
|
return result
|
|
|
|
if __name__ == "__main__":
|
|
if len(sys.argv) < 2:
|
|
d = os.path.join(os.path.pardir, os.path.pardir, "sc2", "content")
|
|
else:
|
|
d = sys.argv[1]
|
|
pkgnames = explorer.get_lists(d)
|
|
packages = [explorer.read_list(x) for x in pkgnames]
|
|
for (name, pkg) in zip(pkgnames, packages):
|
|
newpkg = os.path.splitext(name)[0]+'.ls2'
|
|
print newpkg
|
|
print '-'*len(newpkg)
|
|
newvals = process(pkg)
|
|
for l in newvals:
|
|
print l
|
|
print
|
|
|
|
|
|
|