From: <ror...@us...> - 2007-07-16 05:35:07
|
Revision: 103 http://roreditor.svn.sourceforge.net/roreditor/?rev=103&view=rev Author: rorthomas Date: 2007-07-15 22:35:01 -0700 (Sun, 15 Jul 2007) Log Message: ----------- * added terrain and odef file support Modified Paths: -------------- trunk/lib/ror/depchecker.py Added Paths: ----------- trunk/lib/ror/depcheckerplugins/ror_odef.py trunk/lib/ror/depcheckerplugins/ror_terrn.py Modified: trunk/lib/ror/depchecker.py =================================================================== --- trunk/lib/ror/depchecker.py 2007-07-16 04:51:21 UTC (rev 102) +++ trunk/lib/ror/depchecker.py 2007-07-16 05:35:01 UTC (rev 103) @@ -30,7 +30,9 @@ self.generateCrossDep() if dependfilename != "": self.generateSingleDep() - #self.tryGraph() + + if mode == "all": + self.tryGraph() def savemd5(self): lines = [] @@ -171,6 +173,8 @@ n.set('fillcolor', 'lightyellow') elif ext == ".material": n.set('fillcolor', 'lightseagreen') + elif ext == ".terrn": + n.set('fillcolor', 'forestgreen') elif ext == ".mesh": n.set('fillcolor', 'lightsalmon') elif ext == ".png" or ext == ".jpg" or ext == ".bmp": Added: trunk/lib/ror/depcheckerplugins/ror_odef.py =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_odef.py (rev 0) +++ trunk/lib/ror/depcheckerplugins/ror_odef.py 2007-07-16 05:35:01 UTC (rev 103) @@ -0,0 +1,23 @@ +import os, os.path, re +import subprocess +from deptools import * + +def readFile(filename): + f=open(filename, 'r') + content = f.readlines() + f.close() + return content + +def getDependencies(filename): + content = readFile(filename) + dep = content[0].strip() + return { + OPTIONAL:{ + }, + REQUIRES:{ + FILE:[dep], + }, + PROVIDES:{ + FILE:[filename], + }, + } \ No newline at end of file Added: trunk/lib/ror/depcheckerplugins/ror_terrn.py =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_terrn.py (rev 0) +++ trunk/lib/ror/depcheckerplugins/ror_terrn.py 2007-07-16 05:35:01 UTC (rev 103) @@ -0,0 +1,55 @@ +import os, os.path, re +import subprocess +from deptools import * +#540, 55, 1690, 0, 43, 0, truck wahoo.truck +RE1 = r"^.*,.*,.*,.*,.*,.*,(.*)$" + +def readFile(filename): + f=open(filename, 'r') + content = f.readlines() + f.close() + return content + +def parseRE(content, r): + vals = [] + i = 0 + for line in content: + i += 1 + m = re.match(r, line) + if not m is None and len(m.groups()) > 0: + valname = m.groups()[0] + valname = valname.replace("\t", " ") + valnameg = valname.strip().split(" ") + valname = valnameg[0].strip() + if valname == "truck": + valname = valnameg[-1].strip() + if not valname in vals: + if valname.find("observatory") > 0: + print valnameg + import time + time.sleep(10) + vals.append(valname) + # remove position info + del vals[0] + for i in range(0, len(vals)): + if vals[i].find(".") == -1: + vals[i] += ".odef" + #print vals + return vals + +def getDependencies(filename): + content = readFile(filename) + dep = parseRE(content, RE1) + if len(dep) == 0: + print "no objects found in terrain file " + filename + else: + return { + OPTIONAL:{ + }, + REQUIRES:{ + FILE:dep, + }, + PROVIDES:{ + FILE:[filename], + }, + } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |