You can subscribe to this list here.
2007 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
(64) |
Jul
(77) |
Aug
(21) |
Sep
(15) |
Oct
(3) |
Nov
(4) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(1) |
Feb
|
Mar
(12) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(3) |
Dec
|
From: <ror...@us...> - 2007-07-16 13:18:36
|
Revision: 108 http://roreditor.svn.sourceforge.net/roreditor/?rev=108&view=rev Author: rorthomas Date: 2007-07-16 06:18:30 -0700 (Mon, 16 Jul 2007) Log Message: ----------- * svn update bugfix Modified Paths: -------------- trunk/lib/ror/svn.py Modified: trunk/lib/ror/svn.py =================================================================== --- trunk/lib/ror/svn.py 2007-07-16 12:37:26 UTC (rev 107) +++ trunk/lib/ror/svn.py 2007-07-16 13:18:30 UTC (rev 108) @@ -79,8 +79,11 @@ client = pysvn.Client() # try to restore previous broken updates - client.unlock(path) - client.cleanup(path) + try: + client.unlock(path) + client.cleanup(path) + except: + pass revision_before = getRevision(client, path) print "updating from revision %d ..." % revision_before This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-16 12:37:27
|
Revision: 107 http://roreditor.svn.sourceforge.net/roreditor/?rev=107&view=rev Author: rorthomas Date: 2007-07-16 05:37:26 -0700 (Mon, 16 Jul 2007) Log Message: ----------- * dependency image is now opened after creation Modified Paths: -------------- trunk/lib/ror/depcheckerplugins/ror_mesh.py trunk/lib/ror/starter.py Modified: trunk/lib/ror/depcheckerplugins/ror_mesh.py =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_mesh.py 2007-07-16 12:10:52 UTC (rev 106) +++ trunk/lib/ror/depcheckerplugins/ror_mesh.py 2007-07-16 12:37:26 UTC (rev 107) @@ -16,6 +16,7 @@ def convertToXML(filename): # try to convert to .msh.xml first! cmd = CONVERTERBIN + " " + filename + print "calling " + cmd p = subprocess.Popen(cmd, shell = False, cwd = os.path.dirname(CONVERTERBIN), stderr = subprocess.PIPE, stdout = subprocess.PIPE) p.wait() print "mesh converted: " + filename Modified: trunk/lib/ror/starter.py =================================================================== --- trunk/lib/ror/starter.py 2007-07-16 12:10:52 UTC (rev 106) +++ trunk/lib/ror/starter.py 2007-07-16 12:37:26 UTC (rev 107) @@ -3,6 +3,7 @@ from ror.RoROgreWindow import * from ror.rorcommon import * from subprocess import Popen +import subprocess from ror.logger import log from ror.settingsManager import getSettingsManager @@ -117,14 +118,17 @@ f.close() def OnDepGraph(self, event=None): - dlg = wx.MessageDialog(self, "to get this working, you must install tools/pyparsing*.exe and tools/graphviz*.exe (relative to the installation directory)!", "Info", wx.OK | wx.ICON_INFORMATION) - dlg.ShowModal() - dlg.Destroy() from depchecker import * RoRDepChecker(self.rordir, "all", "") - dlg = wx.MessageDialog(self, "If everything went fine (and you got the correct tools installed), you should find the graph in the RoRToolkit Directory under dependencies.png!\n it is best viewed in firefox.\nred means missing/nout found.", "Info", wx.OK | wx.ICON_INFORMATION) - dlg.ShowModal() - dlg.Destroy() + file = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..\\..\\dependencies.png")) + print file + if os.path.isfile(file): + dlg = wx.MessageDialog(self, "Graph successfully created:\n"+file, "Info", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + cmd = file + p = subprocess.Popen(cmd, shell = True, stderr = subprocess.PIPE, stdout = subprocess.PIPE) + def OnUpdate(self, event=None): import svngui This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-16 12:10:57
|
Revision: 106 http://roreditor.svn.sourceforge.net/roreditor/?rev=106&view=rev Author: rorthomas Date: 2007-07-16 05:10:52 -0700 (Mon, 16 Jul 2007) Log Message: ----------- * version string updated Modified Paths: -------------- trunk/setup.nsi Modified: trunk/setup.nsi =================================================================== --- trunk/setup.nsi 2007-07-16 12:09:58 UTC (rev 105) +++ trunk/setup.nsi 2007-07-16 12:10:52 UTC (rev 106) @@ -2,7 +2,7 @@ ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "RoRToolkit" -!define PRODUCT_VERSION "r50" +!define PRODUCT_VERSION "r105" !define PRODUCT_PUBLISHER "Thomas Fischer" !define PRODUCT_WEB_SITE "http://wiki.rigsofrods.com/index.php?title=RoRToolkit" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-16 12:09:59
|
Revision: 105 http://roreditor.svn.sourceforge.net/roreditor/?rev=105&view=rev Author: rorthomas Date: 2007-07-16 05:09:58 -0700 (Mon, 16 Jul 2007) Log Message: ----------- * console updater now using gui * updated installer * minor improvements to svngui.py Modified Paths: -------------- trunk/lib/ror/svngui.py trunk/setup.nsi trunk/update.py Modified: trunk/lib/ror/svngui.py =================================================================== --- trunk/lib/ror/svngui.py 2007-07-16 05:59:08 UTC (rev 104) +++ trunk/lib/ror/svngui.py 2007-07-16 12:09:58 UTC (rev 105) @@ -12,10 +12,11 @@ import wx, os, os.path class svnUpdate(): - def __init__(self): + def __init__(self, restartApp=True): self.pr = wx.ProgressDialog("Updating ...", "Updating ...", style = wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_ESTIMATED_TIME | wx.PD_REMAINING_TIME) self.pr.Show() self.changes = 0 + self.restartApp = restartApp svn.svnupdate(self.notify) self.showfinished() self.pr.Hide() @@ -34,10 +35,16 @@ dlg.ShowModal() dlg.Destroy() elif self.changes > 2: - dlg = wx.MessageDialog(self.pr, "Update finished!\nThe Application now restarts itself!", "Info", wx.OK | wx.ICON_INFORMATION) - dlg.ShowModal() - dlg.Destroy() - self.restart() + if self.restartApp: + dlg = wx.MessageDialog(self.pr, "Update finished!\nThe Application now restarts itself!", "Info", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + self.restart() + else: + dlg = wx.MessageDialog(self.pr, "Update finished!", "Info", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + def notify(self, event_dict): self.changes += 1 Modified: trunk/setup.nsi =================================================================== --- trunk/setup.nsi 2007-07-16 05:59:08 UTC (rev 104) +++ trunk/setup.nsi 2007-07-16 12:09:58 UTC (rev 105) @@ -47,9 +47,15 @@ ; Instfiles page !insertmacro MUI_PAGE_INSTFILES ; Finish page -!define MUI_FINISHPAGE_RUN "$INSTDIR\rortoolkit.bat" -!define MUI_FINISHPAGE_RUN_PARAMETERS "" +;!define MUI_FINISHPAGE_RUN "$INSTDIR\rortoolkit.bat" +;!define MUI_FINISHPAGE_RUN_PARAMETERS "" #!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Example.file" + +!define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_FINISHPAGE_RUN +!define MUI_FINISHPAGE_RUN_NOTCHECKED +!define MUI_FINISHPAGE_RUN_TEXT "Update and start (Can take some time)" +!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchPostInstallation" !insertmacro MUI_PAGE_FINISH ; Uninstaller pages @@ -74,7 +80,8 @@ Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" OutFile "RoRToolkitSetup.exe" -InstallDir "$PROGRAMFILES\RoRToolkit" +;InstallDir "$PROGRAMFILES\RoRToolkit" +InstallDir "c:\rortoolkit" ShowInstDetails show ShowUnInstDetails show @@ -160,7 +167,25 @@ Banner::destroy FunctionEnd +Function InstallPyParsing + InitPluginsDir + File /oname=$PLUGINSDIR\pyparsing-1.4.6.win32.exe "tools\pyparsing-1.4.6.win32.exe" + Banner::show /NOUNLOAD "Installing PyParsing Python Module ..." + ExecWait '"$PLUGINSDIR\pyparsing-1.4.6.win32.exe"' + Delete $PLUGINSDIR\pyparsing-1.4.6.win32.exe + Banner::destroy +FunctionEnd +Function InstallGraphViz + InitPluginsDir + File /oname=$PLUGINSDIR\graphviz-2.12.exe "tools\graphviz-2.12.exe" + Banner::show /NOUNLOAD "Installing Graphviz for Windows ..." + ExecWait '"$PLUGINSDIR\graphviz-2.12.exe"' + Delete $PLUGINSDIR\graphviz-2.12.exe + Banner::destroy +FunctionEnd + + Function .onInit InitPluginsDir File /oname=$PLUGINSDIR\splash.bmp "splash.bmp" @@ -174,20 +199,24 @@ Call CheckForPython SectionEnd -Section "Install DirectX" SEC02 +Section "Install Tools" SEC02 Call InstallDirectX -SectionEnd - -Section "Install PyWin32" SEC03 Call InstallPyWin32 + Call InstallPyParsing + Call InstallGraphViz SectionEnd -Section "Full Installation" SEC04 +Section "Full Installation" SEC03 SetOutPath "$INSTDIR" SetOverwrite try File "/r" "*" SectionEnd +Function "LaunchPostInstallation" + ExecWait '"$INSTDIR\update.bat"' + ExecWait '"$INSTDIR\rortoolkit.bat"' +FunctionEnd + Section -AdditionalIcons SetOutPath $INSTDIR WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" Modified: trunk/update.py =================================================================== --- trunk/update.py 2007-07-16 05:59:08 UTC (rev 104) +++ trunk/update.py 2007-07-16 12:09:58 UTC (rev 105) @@ -2,8 +2,20 @@ def main(): sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib")) - import ror.svn - ror.svn.run() + guiVersion = True + if guiVersion: + import wx + + MainApp = wx.PySimpleApp(0) + wx.InitAllImageHandlers() #you may or may not need this + import ror.svngui + gui = ror.svngui.svnUpdate(False) + del gui + else: + #non-gui version: + import ror.svn + ror.svn.run() + if __name__=="__main__": main() \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-16 05:59:09
|
Revision: 104 http://roreditor.svn.sourceforge.net/roreditor/?rev=104&view=rev Author: rorthomas Date: 2007-07-15 22:59:08 -0700 (Sun, 15 Jul 2007) Log Message: ----------- * minor improvements in depchecker.py Modified Paths: -------------- trunk/lib/ror/depchecker.py Modified: trunk/lib/ror/depchecker.py =================================================================== --- trunk/lib/ror/depchecker.py 2007-07-16 05:35:01 UTC (rev 103) +++ trunk/lib/ror/depchecker.py 2007-07-16 05:59:08 UTC (rev 104) @@ -156,7 +156,7 @@ graph.set_type('digraph') graph.simplify = True #graph.set("resolution", "320") - #graph.set("overlap", "0") + #graph.set("overlap", "scale") #graph.set("shape", "box") for n in graph.get_node_list(): @@ -182,12 +182,16 @@ + #graph.set("ranksep", "2") + #graph.set("splines", True) program = "dot" # dot or twopi + # this takes very long: #if len(self.filedeps) > 100: # program = "twopi" + # graph.set("overlap", "scale") graph.write(fn, prog = program, format='png') - print "graph successfull written to dependencies.png" + print "graph successfull written to " + fn def generateCrossDep(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <ror...@us...> - 2007-07-16 04:51:22
|
Revision: 102 http://roreditor.svn.sourceforge.net/roreditor/?rev=102&view=rev Author: rorthomas Date: 2007-07-15 21:51:21 -0700 (Sun, 15 Jul 2007) Log Message: ----------- * added single graph dependency checking Modified Paths: -------------- trunk/lib/ror/depchecker.py Modified: trunk/lib/ror/depchecker.py =================================================================== --- trunk/lib/ror/depchecker.py 2007-07-15 19:03:22 UTC (rev 101) +++ trunk/lib/ror/depchecker.py 2007-07-16 04:51:21 UTC (rev 102) @@ -30,7 +30,7 @@ self.generateCrossDep() if dependfilename != "": self.generateSingleDep() - self.tryGraph() + #self.tryGraph() def savemd5(self): lines = [] @@ -51,8 +51,8 @@ for rsub in req: if rr['filename'] == rsub['filename']: duplicate = True - if not duplicate: - req.append(rr) + #if not duplicate: + req.append(rr) except: pass return req @@ -68,7 +68,8 @@ t['md5sum'] = self.md5Sum(t['fullpath']) print "%-30s %-30s" % ("+"*t['depth']+t['filename'], t['md5sum']) #self.removeOriginalFilesFromSingleDep - #for f in self.filedeps.keys(): + #for t in tree: + # f = t['filename'] # print str(self.filedeps[f][REQUIRES]) # print str(self.filedeps[f][REQUIREDBY]) # print "---------------------------------" @@ -121,7 +122,31 @@ for rel in fileA[REQUIRES][FILE]: e = (filenameA, rel) edges.append(e) + fn = 'dependencies.png' else: + od = -1 + parents = [] + for t in tree: + d = t['depth'] + f = t['filename'] + if d > od: + if len(parents) > 0: + #print "1", (parents[-1], f) + edges.append((parents[-1], f)) + parents.append(f) + elif d == od: + #print "2" + edges.append((parents[-1], f)) + elif d < od: + for i in range(0, od - d + 1): + del parents[-1] + #print "3", od - d, (parents[-1], f) + edges.append((parents[-1], f)) + parents.append(f) + + + od = d + fn = 'dependencies_single.png' pass #edges = [(1,2), (1,3), (1,4), (3,4)] @@ -157,7 +182,7 @@ #if len(self.filedeps) > 100: # program = "twopi" - graph.write('dependencies.png', prog = program, format='png') + graph.write(fn, prog = program, format='png') print "graph successfull written to dependencies.png" @@ -302,6 +327,8 @@ sys.exit(0) def main(): + if len(sys.argv) < 3: + usage() if not os.path.isdir(sys.argv[1]): print "%s is not a valid directory!" % sys.argv[1] usage() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-15 19:03:29
|
Revision: 101 http://roreditor.svn.sourceforge.net/roreditor/?rev=101&view=rev Author: rorthomas Date: 2007-07-15 12:03:22 -0700 (Sun, 15 Jul 2007) Log Message: ----------- * added camera land collision checkbox Modified Paths: -------------- trunk/lib/rorterraineditor/MainFrame.py trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py Modified: trunk/lib/rorterraineditor/MainFrame.py =================================================================== --- trunk/lib/rorterraineditor/MainFrame.py 2007-07-08 20:27:33 UTC (rev 100) +++ trunk/lib/rorterraineditor/MainFrame.py 2007-07-15 19:03:22 UTC (rev 101) @@ -20,6 +20,7 @@ ID_ADDMESH = 108 ID_CHECKUPDATE = 109 ID_SAVEFILEAS = 110 +ID_TERRAINCOLLISION = 111 ID_EXIT = 199 DATADIR = "data" @@ -133,10 +134,13 @@ menuBar.Append(file_menu, "&File"); view_menu = wx.Menu() + self.mnuterraincollision = view_menu.AppendCheckItem(ID_TERRAINCOLLISION, "Camera collides with Terrain", "") + self.mnuterraincollision.Check(True) + view_menu.AppendSeparator() self.viewObjectDetails = view_menu.AppendCheckItem(ID_VIEWOBJ, "&View Objects", "Display object details") + self.viewObjectDetails.Check(False) view_menu.AppendSeparator() view_menu.Append(ID_OGRESET, "&Ogre Settings", "Change Ogre Display Settings") - self.viewObjectDetails.Check(False) menuBar.Append(view_menu, "&View"); add_menu = wx.Menu() @@ -163,7 +167,7 @@ self.Bind(wx.EVT_MENU, self.OnAbout, id=ID_ABOUT) self.Bind(wx.EVT_MENU, self.onViewObjectDetails, id=ID_VIEWOBJ) self.Bind(wx.EVT_MENU, self.OnChangeOgreSettings, id=ID_OGRESET) - self.Bind(wx.EVT_MENU, self.OnHelp, id=ID_SHOWHELP) + self.Bind(wx.EVT_MENU, self.OnCameraTerrainCollision, id=ID_TERRAINCOLLISION) def OnAbout(self, event=None): ShowOnAbout() @@ -171,6 +175,9 @@ def OnCheckUpdate(self, event=None): pass + def OnCameraTerrainCollision(self, event=None): + self.terrainOgreWin.CameraLandCollision(self.mnuterraincollision.IsChecked()) + def OnHelp(self, event=None): import HelpFrame HelpFrame.showHelpFrame() Modified: trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py =================================================================== --- trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py 2007-07-08 20:27:33 UTC (rev 100) +++ trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py 2007-07-15 19:03:22 UTC (rev 101) @@ -34,6 +34,7 @@ self.myODefs = {} self.trucks = {} self.comments = {} + self.cameralandcollisionenabled = True self.meshes = {} self.keyPress = ogre.Vector3(0,0,0) self.moveVector = ogre.Vector3(0,0,0) @@ -41,6 +42,8 @@ self.selectionMaterialAnimState = 0 wxOgreWindow.__init__(self, self.parent, self.ID, size = self.size, **self.kwargs) + def CameraLandCollision(self, value): + self.cameralandcollisionenabled = value def animateSelection(self): if not self.selectionMaterial is None: @@ -52,8 +55,9 @@ self.selectionMaterial.setDiffuse(1, 0.3, 0, val) self.selectionMaterial.setSpecular(1, 0.3, 0, val) - def OnFrameStarted(self): - self.cameraLandCollision() + def OnFrameStarted(self): + if self.cameralandcollisionenabled: + self.cameraLandCollision() self.animateSelection() if not self.TranslateNode is None: if self.mSelected: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-08 20:27:40
|
Revision: 100 http://roreditor.svn.sourceforge.net/roreditor/?rev=100&view=rev Author: rorthomas Date: 2007-07-08 13:27:33 -0700 (Sun, 08 Jul 2007) Log Message: ----------- * added pydot / missing files Added Paths: ----------- trunk/lib/dot_parser.py trunk/lib/pydot.py Added: trunk/lib/dot_parser.py =================================================================== --- trunk/lib/dot_parser.py (rev 0) +++ trunk/lib/dot_parser.py 2007-07-08 20:27:33 UTC (rev 100) @@ -0,0 +1,380 @@ +# -*- coding: Latin-1 -*- +"""Graphviz's dot language parser. + +The dotparser parses graphviz files in dot and dot files and transforms them +into a class representation defined by pydot. + +The module needs pyparsing (tested with version 1.2.2) and pydot (tested with 0.9.10) + +Author: Michael Krause <mi...@kr...> +""" + +__author__ = 'Michael Krause' +__license__ = 'MIT' + +import sys +import glob +import pydot +import re + +from pyparsing import __version__ as pyparsing_version +from pyparsing import Literal, CaselessLiteral, Word, \ + Upcase, OneOrMore, ZeroOrMore, Forward, NotAny, \ + delimitedList, oneOf, Group, Optional, Combine, \ + alphas, nums, restOfLine, cStyleComment, nums, \ + alphanums, printables, empty, quotedString, \ + ParseException, ParseResults, CharsNotIn, _noncomma,\ + dblQuotedString + + +class P_AttrList: + def __init__(self, toks): + self.attrs = {} + i = 0 + while i < len(toks): + attrname = toks[i] + attrvalue = toks[i+1] + self.attrs[attrname] = attrvalue + i += 2 + + def __repr__(self): + return "%s(%r)" % (self.__class__.__name__, self.attrs) + + +class DefaultStatement(P_AttrList): + def __init__(self, default_type, attrs): + self.default_type = default_type + self.attrs = attrs + + def __repr__(self): + return "%s(%s, %r)" % \ + (self.__class__.__name__, self.default_type, self.attrs) + + +def push_top_graph_stmt(str, loc, toks): + attrs = {} + g = None + + for element in toks: + if isinstance(element, ParseResults) or \ + isinstance(element, tuple) or \ + isinstance(element, list): + + element = element[0] + + if element == 'strict': + attrs['strict'] = True + elif element in ['graph', 'digraph']: + attrs['graph_type'] = element + elif type(element) == type(''): + attrs['graph_name'] = element + elif isinstance(element, pydot.Graph): + g = pydot.Graph(**attrs) + g.__dict__.update(element.__dict__) + for e in g.get_edge_list(): + e.parent_graph = g + for e in g.get_node_list(): + e.parent_graph = g + for e in g.get_subgraph_list(): + e.set_graph_parent(g) + + elif isinstance(element, P_AttrList): + attrs.update(element.attrs) + else: + raise ValueError, "Unknown element statement: %r " % element + + if g is not None: + g.__dict__.update(attrs) + return g + + +def add_defaults(element, defaults): + d = element.__dict__ + for key, value in defaults.items(): + if not d.get(key): + d[key] = value + + +def add_elements(g, toks, defaults_graph=None, defaults_node=None, defaults_edge=None): + + if defaults_graph is None: + defaults_graph = {} + if defaults_node is None: + defaults_node = {} + if defaults_edge is None: + defaults_edge = {} + + for element in toks: + if isinstance(element, pydot.Graph): + add_defaults(element, defaults_graph) + g.add_subgraph(element) + elif isinstance(element, pydot.Node): + add_defaults(element, defaults_node) + g.add_node(element) + elif isinstance(element, pydot.Edge): + add_defaults(element, defaults_edge) + g.add_edge(element) + elif isinstance(element, ParseResults): + for e in element: + add_elements(g, [e], defaults_graph, defaults_node, defaults_edge) + elif isinstance(element, DefaultStatement): + if element.default_type == 'graph': + default_graph_attrs = pydot.Node('graph') + default_graph_attrs.__dict__.update(element.attrs) + g.add_node(default_graph_attrs) + defaults_graph.update(element.attrs) + g.__dict__.update(element.attrs) + elif element.default_type == 'node': + default_node_attrs = pydot.Node('node') + default_node_attrs.__dict__.update(element.attrs) + g.add_node(default_node_attrs) +# defaults_node.update(element.attrs) + elif element.default_type == 'edge': + default_edge_attrs = pydot.Node('edge') + default_edge_attrs.__dict__.update(element.attrs) + g.add_node(default_edge_attrs) + defaults_edge.update(element.attrs) + else: + raise ValueError, "Unknown DefaultStatement: %s " % element.default_type + elif isinstance(element, P_AttrList): + g.__dict__.update(element.attrs) + else: + raise ValueError, "Unknown element statement: %r " % element + + +def push_graph_stmt(str, loc, toks): + g = pydot.Subgraph() + add_elements(g, toks) + return g + + +def push_subgraph_stmt(str, loc, toks): + + for e in toks: + if len(e)==3: + g = e[2] + g.set_name(e[1]) + if len(e)==1: + e[0].set_name('') + return e[0] + + return g + + +def push_default_stmt(str, loc, toks): + # The pydot class instances should be marked as + # default statements to be inherited by actual + # graphs, nodes and edges. + # print "push_default_stmt", toks + default_type = toks[0][0] + if len(toks) > 1: + attrs = toks[1].attrs + else: + attrs = {} + + if default_type in ['graph', 'node', 'edge']: + return DefaultStatement(default_type, attrs) + else: + raise ValueError, "Unknown default statement: %r " % toks + + +def push_attr_list(str, loc, toks): + p = P_AttrList(toks) + return p + + +def get_port(node): + + if len(node)>1: + if isinstance(node[1], ParseResults): + if len(node[1][0])==2: + if node[1][0][0]==':': + return node[1][0][1] + + return None + + +def do_node_ports(n_prev, n_next): + port = get_port(n_prev) + if port is not None: + n_prev_port = ':'+port + else: + n_prev_port = '' + + port = get_port(n_next) + if port is not None: + n_next_port = ':'+port + else: + n_next_port = '' + + return (n_prev_port, n_next_port) + + +def push_edge_stmt(str, loc, toks): + + tok_attrs = [a for a in toks if isinstance(a, P_AttrList)] + attrs = {} + for a in tok_attrs: + attrs.update(a.attrs) + + e = [] + n_prev = toks[0] + if isinstance(toks[2][0], pydot.Graph): + n_next_list = [[n.get_name(),] for n in toks[2][0].get_node_list()] + for n_next in [n for n in n_next_list]: + n_prev_port, n_next_port = do_node_ports(n_prev, n_next) + e.append(pydot.Edge(n_prev[0]+n_prev_port, n_next[0]+n_next_port, **attrs)) + else: + for n_next in [n for n in tuple(toks)[2::2]]: + n_prev_port, n_next_port = do_node_ports(n_prev, n_next) + e.append(pydot.Edge(n_prev[0]+n_prev_port, n_next[0]+n_next_port, **attrs)) + n_prev = n_next + + return e + + +def push_node_stmt(str, loc, toks): + + if len(toks) == 2: + attrs = toks[1].attrs + else: + attrs = {} + + node_name = toks[0] + if isinstance(node_name, list) or isinstance(node_name, tuple): + if len(node_name)>0: + node_name = node_name[0] + + n = pydot.Node('"'+node_name+'"', **attrs) + return n + + +def strip_quotes( s, l, t ): + return [ t[0].strip('"') ] + + +graphparser = None +def graph_definition(): + global graphparser + + if not graphparser: + # punctuation + colon = Literal(":") + lbrace = Literal("{") + rbrace = Literal("}") + lbrack = Literal("[") + rbrack = Literal("]") + lparen = Literal("(") + rparen = Literal(")") + equals = Literal("=") + comma = Literal(",") + dot = Literal(".") + slash = Literal("/") + bslash = Literal("\\") + star = Literal("*") + semi = Literal(";") + at = Literal("@") + minus = Literal("-") + + # keywords + strict_ = Literal("strict") + graph_ = Literal("graph") + digraph_ = Literal("digraph") + subgraph_ = Literal("subgraph") + node_ = Literal("node") + edge_ = Literal("edge") + + + # token definitions + + identifier = Word(alphanums + "_" ).setName("identifier") + + double_quoted_string = dblQuotedString + + alphastring_ = OneOrMore(CharsNotIn(_noncomma)) + + ID = (identifier | double_quoted_string.setParseAction(strip_quotes) |\ + alphastring_).setName("ID") + + html_text = Combine(Literal("<<") + OneOrMore(CharsNotIn(",]"))) + + float_number = Combine(Optional(minus) + \ + OneOrMore(Word(nums + "."))).setName("float_number") + + righthand_id = (float_number | ID | html_text).setName("righthand_id") + + port_angle = (at + ID).setName("port_angle") + + port_location = (Group(colon + ID) | \ + Group(colon + lparen + ID + comma + ID + rparen)).setName("port_location") + + port = (Group(port_location + Optional(port_angle)) | \ + Group(port_angle + Optional(port_location))).setName("port") + + node_id = (ID + Optional(port)) + a_list = OneOrMore(ID + Optional(equals.suppress() + righthand_id) + \ + Optional(comma.suppress())).setName("a_list") + + attr_list = OneOrMore(lbrack.suppress() + Optional(a_list) + \ + rbrack.suppress()).setName("attr_list") + + attr_stmt = (Group(graph_ | node_ | edge_) + attr_list).setName("attr_stmt") + + edgeop = (Literal("--") | Literal("->")).setName("edgeop") + + stmt_list = Forward() + graph_stmt = Group(lbrace.suppress() + Optional(stmt_list) + \ + rbrace.suppress()).setName("graph_stmt") + + subgraph = (Group(Optional(subgraph_ + Optional(ID)) + graph_stmt) | \ + Group(subgraph_ + ID)).setName("subgraph") + + edgeRHS = OneOrMore(edgeop + Group(node_id | subgraph)) + + edge_stmt = Group(node_id | subgraph) + edgeRHS + Optional(attr_list) + + node_stmt = (node_id + Optional(attr_list) + Optional(semi.suppress())).setName("node_stmt") + + assignment = (ID + equals.suppress() + righthand_id).setName("assignment") + stmt = (assignment | edge_stmt | attr_stmt | subgraph | node_stmt).setName("stmt") + stmt_list << OneOrMore(stmt + Optional(semi.suppress())) + + graphparser = (Optional(strict_) + Group((graph_ | digraph_)) + \ + Optional(ID) + graph_stmt).setResultsName("graph") + + singleLineComment = "//" + restOfLine + + + # actions + + graphparser.ignore(singleLineComment) + graphparser.ignore(cStyleComment) + + assignment.setParseAction(push_attr_list) + a_list.setParseAction(push_attr_list) + edge_stmt.setParseAction(push_edge_stmt) + node_stmt.setParseAction(push_node_stmt) + attr_stmt.setParseAction(push_default_stmt) + + subgraph.setParseAction(push_subgraph_stmt) + graph_stmt.setParseAction(push_graph_stmt) + graphparser.setParseAction(push_top_graph_stmt) + + + return graphparser + + +def parse_dot_data(data): + try: + data = data.replace('\\\n', '') + graphparser = graph_definition() + if pyparsing_version >= '1.2': + graphparser.parseWithTabs() + tokens = graphparser.parseString(data) + graph = tokens.graph + return graph + except ParseException, err: + print err.line + print " "*(err.column-1) + "^" + print err + return None Added: trunk/lib/pydot.py =================================================================== --- trunk/lib/pydot.py (rev 0) +++ trunk/lib/pydot.py 2007-07-08 20:27:33 UTC (rev 100) @@ -0,0 +1,1234 @@ +# -*- coding: Latin-1 -*- +"""Graphviz's dot language Python interface. + +This module provides with a full interface to create handle modify +and process graphs in Graphviz's dot language. + +References: + +pydot Homepage: http://www.dkbza.org/pydot.html +Graphviz: http://www.research.att.com/sw/tools/graphviz/ +DOT Language: http://www.research.att.com/~erg/graphviz/info/lang.html + +Programmed and tested with Graphviz 1.16 and Python 2.3.4 on GNU/Linux +by Ero Carrera (c) 2004 [er...@dk...] + +Distributed under MIT license [http://opensource.org/licenses/mit-license.html]. +""" + +__author__ = 'Ero Carrera' +__version__ = '0.9.10' +__license__ = 'MIT' + +import os +import tempfile +import copy +import dot_parser + + +def graph_from_dot_data(data): + """Load graph as defined by data in DOT format. + + The data is assumed to be in DOT format. It will + be parsed and a Dot class will be returned, + representing the graph. + """ + + graph = dot_parser.parse_dot_data(data) + if graph is not None: + dot = Dot() + dot.__dict__.update(graph.__dict__) + return dot + + return None + +def graph_from_dot_file(path): + """Load graph as defined by a DOT file. + + The file is assumed to be in DOT format. It will + be loaded, parsed and a Dot class will be returned, + representing the graph. + """ + + fd = file(path, 'rb') + data = fd.read() + fd.close() + + return graph_from_dot_data(data) + + +def graph_from_edges(edge_list, node_prefix='', directed=False): + """Creates a basic graph out of an edge list. + + The edge list has to be a list of tuples representing + the nodes connected by the edge. + The values can be anything: bool, int, float, str. + + If the graph is undirected by default, it is only + calculated from one of the symmetric halves of the matrix. + """ + if directed: + graph = Dot(graph_type='digraph') + else: + graph = Dot(graph_type='graph') + for edge in edge_list: + e = Edge(node_prefix+str(edge[0]), node_prefix+str(edge[1])) + graph.add_edge(e) + return graph + + +def graph_from_adjacency_matrix(matrix, node_prefix='', directed=False): + """Creates a basic graph out of an adjacency matrix. + + The matrix has to be a list of rows of values + representing an adjacency matrix. + The values can be anything: bool, int, float, as long + as they can evaluate to True or False. + """ + node_orig = 1 + if directed: + graph = Dot(graph_type='digraph') + else: + graph = Dot(graph_type='graph') + for row in matrix: + if not directed: + skip = matrix.index(row) + r = row[skip:] + else: + skip = 0 + r = row + node_dest = skip+1 + for e in r: + if e: + graph.add_edge( \ + Edge( node_prefix+str(node_orig), \ + node_prefix+str(node_dest))) + node_dest += 1 + node_orig += 1 + return graph + +def graph_from_incidence_matrix(matrix, node_prefix='', directed=False): + """Creates a basic graph out of an incidence matrix. + + The matrix has to be a list of rows of values + representing an incidence matrix. + The values can be anything: bool, int, float, as long + as they can evaluate to True or False. + """ + node_orig = 1 + if directed: + graph = Dot(graph_type='digraph') + else: + graph = Dot(graph_type='graph') + for row in matrix: + nodes = [] + c = 1 + for node in row: + if node: + nodes.append(c*node) + c += 1 + nodes.sort() + if len(nodes) == 2: + graph.add_edge( \ + Edge(node_prefix+str(abs(nodes[0])), \ + node_prefix+str(nodes[1]) )) + if not directed: + graph.set_simplify(True) + return graph + + +def find_graphviz(): + """Locate Graphviz's executables in the system. + + Attempts to locate graphviz's executables in a Unix system. + It will look for 'dot', 'twopi' and 'neato' in all the directories + specified in the PATH environment variable. + It will return a dictionary containing the program names as keys + and their paths as values. + """ + progs = {'dot': '', 'twopi': '', 'neato': '', 'circo': '', 'fdp': ''} + if not os.environ.has_key('PATH'): + return None + for path in os.environ['PATH'].split(os.pathsep): + for prg in progs.keys(): + if os.path.exists(path+os.path.sep+prg): + progs[prg] = path+os.path.sep+prg + elif os.path.exists(path+os.path.sep+prg + '.exe'): + progs[prg] = path+os.path.sep+prg + '.exe' + return progs + +class Common: + """Common information to several classes. + + Should not be directly used, several classes are derived from + this one. + """ + chars_ID = None + parent_graph = None + + def char_range(self, a,b): + """Generate a list containing a range of characters. + + Returns a list of characters starting from 'a' up to 'b' + both inclusive. + """ + return map(chr, range(ord(a), ord(b)+1)) + + def is_ID(self, s): + """Checks whether a string is an dot language ID. + + It will check whether the string is solely composed + by the characters allowed in an ID or not. + """ + if not self.chars_ID: + self.chars_ID = self.char_range('a','z')+self.char_range('A','Z')+ \ + self.char_range('0','9')+['_'] + for c in s: + if c not in self.chars_ID: + return False + return True + +class Error(Exception): + """General error handling class. + """ + def __init__(self, value): + self.value = value + def __str__(self): + return self.value + + +class Node(object, Common): + """A graph node. + + This class represents a graph's node with all its attributes. + + node(name, attribute=value, ...) + + name: node's name + + All the attributes defined in the Graphviz dot language should + be supported. + """ + attributes = ['showboxes', 'URL', 'fontcolor', 'fontsize', 'label', 'fontname', \ + 'comment', 'root', 'toplabel', 'vertices', 'width', 'z', 'bottomlabel', \ + 'distortion', 'fixedsize', 'group', 'height', 'orientation', 'pin', \ + 'rects', 'regular', 'shape', 'shapefile', 'sides', 'skew', 'pos', \ + 'layer', 'tooltip', 'style', 'target', 'color', 'peripheries', + 'fillcolor', 'margin', 'nojustify'] + + def __init__(self, name, **attrs): + + if isinstance(name, str) and not name.startswith('"'): + idx = name.find(':') + if idx>0: + name = name[:idx] + + self.name = str(name) + for attr in self.attributes: + # Set all the attributes to None. + self.__setattr__(attr, None) + # Generate all the Setter methods. + self.__setattr__('set_'+attr, lambda x, a=attr : self.__setattr__(a, x)) + # Generate all the Getter methods. + self.__setattr__('get_'+attr, lambda a=attr : self.__get_attribute__(a)) + for attr, val in attrs.items(): + self.__setattr__(attr, val) + + def __getstate__(self): + + dict = copy.copy(self.__dict__) + for attr in self.attributes: + del dict['set_'+attr] + del dict['get_'+attr] + + return dict + + def __setstate__(self, state): + for k, v in state.items(): + self.__setattr__(k, v) + + def __get_attribute__(self, attr): + """Look for default attributes for this node""" + attr_val = self.__getattribute__(attr) + if attr_val is None: + defaults = self.parent_graph.get_node('node') + if defaults: + attr_val = defaults.__getattribute__(attr) + if attr_val: + return attr_val + else: + return attr_val + return None + + + def set_name(self, node_name): + """Set the node's name.""" + + self.name = str(node_name) + + def get_name(self): + """Get the node's name.""" + + return self.name + + def set(self, name, value): + """Set an attribute value by name. + + Given an attribute 'name' it will set its value to 'value'. + There's always the possibility of using the methods: + set_'name'(value) + which are defined for all the existing attributes. + """ + if name in self.attributes: + self.__dict__[name] = value + return True + # Attribute is not known + return False + + def to_string(self): + """Returns a string representation of the node in dot language. + """ + + if not isinstance(self.name, str): + self.name = str(self.name) + + # RMF: special case defaults for node, edge and graph properties. + if self.name in ['node', 'edge', 'graph'] or self.name.startswith('"'): + node = self.name + else: + node = '"'+self.name+'"' + + node_attr = None + all_attrs = [a for a in self.attributes] + all_attrs += [a for a in Graph.attributes if a not in all_attrs] + all_attrs += [a for a in Edge.attributes if a not in all_attrs] + for attr in all_attrs: + if self.__dict__.has_key(attr) \ + and self.__getattribute__(attr) is not None: + if not node_attr: + node_attr = '' + else: + node_attr += ', ' + node_attr += attr+'=' + val = str(self.__dict__[attr]) + + if val.startswith('<') and val.endswith('>'): + node_attr += val + elif ((isinstance(val, str) or isinstance(val, unicode)) and \ + not self.is_ID(val)) or val == '' : + + node_attr += '"'+val+'"' + else: + node_attr += str(val) + + if node_attr: + node += ' ['+node_attr+']' + node += ';' + + return node + + +class Edge(object, Common): + """A graph edge. + + This class represents a graph's edge with all its attributes. + + edge(src, dst, attribute=value, ...) + + src: source node's name + dst: destination node's name + + All the attributes defined in the Graphviz dot language should + be supported. + + Attributes can be set through the dynamically generated methods: + + set_[attribute name], i.e. set_label, set_fontname + + or using the instance's attributes: + + Edge.[attribute name], i.e. edge_instance.label, edge_instance.fontname + """ + attributes = ['style', 'target', 'pos', 'layer', 'tooltip', 'color', 'showboxes',\ + 'URL', 'fontcolor', 'fontsize', 'label', 'fontname', 'comment', 'lp', \ + 'arrowhead', 'arrowsize', 'arrowtail', 'constraint', 'decorate', 'dir', \ + 'headURL', 'headclip', 'headhref', 'headlabel', 'headport', \ + 'headtarget', 'headtooltip', 'href', 'labelangle', 'labeldistance', \ + 'labelfloat', 'labelfontcolor', 'labelfontname', 'labelfontsize', 'len',\ + 'lhead', 'ltail', 'minlen', 'samehead', 'sametail', 'weight', 'tailURL',\ + 'tailclip', 'tailhref', 'taillabel', 'tailport', 'tailtarget', \ + 'tailtooltip', 'nojustify'] + + def __init__(self, src, dst, **attrs): + self.src = src + self.dst = dst + for attr in self.attributes: + # Set all the attributes to None. + self.__setattr__(attr, None) + # Generate all the Setter methods. + self.__setattr__('set_'+attr, lambda x, a=attr : self.__setattr__(a, x)) + # Generate all the Getter methods. + self.__setattr__('get_'+attr, lambda a=attr : self.__get_attribute__(a)) + for attr, val in attrs.items(): + self.__setattr__(attr, val) + + def __getstate__(self): + + dict = copy.copy(self.__dict__) + for attr in self.attributes: + del dict['set_'+attr] + del dict['get_'+attr] + + return dict + + def __setstate__(self, state): + for k, v in state.items(): + self.__setattr__(k, v) + + def __get_attribute__(self, attr): + """Look for default attributes for this edge""" + attr_val = self.__getattribute__(attr) + if attr_val is None: + defaults = self.parent_graph.get_node('edge') + if defaults: + attr_val = defaults.__getattribute__(attr) + if attr_val: + return attr_val + else: + return attr_val + return None + + + def get_source(self): + """Get the edges source node name.""" + + return self.src + + def get_destination(self): + """Get the edge's destination node name.""" + + return self.dst + + def __eq__(self, edge): + """Compare two edges. + + If the parent graph is directed, arcs linking + node A to B are considered equal and A->B != B->A + + If the parent graph is undirected, any edge + connecting two nodes is equal to any other + edge connecting the same nodes, A->B == B->A + """ + + if not isinstance(edge, Edge): + raise Error, 'Can\'t compare and edge to a non-edge object.' + if self.parent_graph.graph_type=='graph': + # If the graph is undirected, the edge has neither + # source nor destination. + if (self.src==edge.src and self.dst==edge.dst) or \ + (self.src==edge.dst and self.dst==edge.src): + return True + else: + if self.src==edge.src and self.dst==edge.dst: + return True + return False + + + def set(self, name, value): + """Set an attribute value by name. + + Given an attribute 'name' it will set its value to 'value'. + There's always the possibility of using the methods: + set_'name'(value) + which are defined for all the existing attributes. + """ + if name in self.attributes: + self.__dict__[name] = value + return True + # Attribute is not known + return False + + + def parse_node_ref(self, node_str): + + if not isinstance(node_str, str): + node_str = str(node_str) + + if node_str[0]=='"' and node_str[-1]=='"' and node_str[0].count('"')%2!=0: + return node_str + + node_port_idx = node_str.rfind(':') + + if node_port_idx>0 and node_str[0]=='"' and node_str[node_port_idx-1]=='"': + return node_str + + node_str = node_str.replace('"', '') + + if node_port_idx>0: + a = node_str[:node_port_idx] + b = node_str[node_port_idx+1:] + if self.is_ID(a): + node = a + else: + node = '"'+a+'"' + if self.is_ID(b): + node += ':'+b + else: + node+=':"'+b+'"' + return node + + return '"'+node_str+'"' + + + def to_string(self): + """Returns a string representation of the edge in dot language. + """ + + src = self.parse_node_ref(self.src) + dst = self.parse_node_ref(self.dst) + + edge = src + if self.parent_graph and \ + self.parent_graph.graph_type and \ + self.parent_graph.graph_type=='digraph': + edge+=' -> ' + else: + edge+=' -- ' + edge+=dst + + edge_attr = None + for attr in self.attributes: + if self.__dict__.has_key(attr) \ + and self.__getattribute__(attr) is not None: + if not edge_attr: + edge_attr = '' + else: + edge_attr+=', ' + edge_attr+=attr+'=' + val = str(self.__dict__[attr]) + if (isinstance(val, str) or isinstance(val, unicode)) and not self.is_ID(val): + edge_attr+='"'+val+'"' + else: + edge_attr+=str(val) + + if edge_attr: + edge+=' ['+edge_attr+']' + edge+=';' + + return edge + +class Graph(object, Common): + + """Class representing a graph in Graphviz's dot language. + + This class implements the methods to work on a representation + of a graph in Graphviz's dot language. + + graph(graph_name='G', type='digraph', strict=False, suppress_disconnected=False, attribute=value, ...) + + graph_name: + the graph's name + type: + can be 'graph' or 'digraph' + suppress_disconnected: + defaults to False, which will remove from the + graph any disconnected nodes. + simplify: + if True it will avoid displaying equal edges, i.e. + only one edge between two nodes. removing the + duplicated ones. + + All the attributes defined in the Graphviz dot language should + be supported. + + Attributes can be set through the dynamically generated methods: + + set_[attribute name], i.e. set_size, set_fontname + + or using the instance's attributes: + + Graph.[attribute name], i.e. graph_instance.label, graph_instance.fontname + """ + + attributes = ['Damping', 'bb', 'center', 'clusterrank', 'compound', 'concentrate',\ + 'defaultdist', 'dim', 'fontpath', 'epsilon', 'layers', 'layersep', \ + 'margin', 'maxiter', 'mclimit', 'mindist', 'pack', 'packmode', 'model', \ + 'page', 'pagedir', 'nodesep', 'normalize', 'nslimit1', 'ordering', \ + 'orientation', 'outputorder', 'overlap', 'remincross', 'resolution', \ + 'rankdir', 'ranksep', 'ratio', 'rotate', 'samplepoints', 'searchsize', \ + 'sep', 'size', 'splines', 'start', 'stylesheet', 'truecolor', \ + 'viewport', 'voro_margin', 'quantum', 'bgcolor', 'labeljust', \ + 'labelloc', 'root', 'showboxes', 'URL', 'fontcolor', 'fontsize', \ + 'label' ,'fontname', 'comment', 'lp', 'target', 'color', 'style', \ + 'concentrators', 'rank', 'dpi', 'mode', 'nojustify', 'nslimit'] + + def __init__(self, graph_name='G', graph_type='digraph', strict=False, \ + suppress_disconnected=False, simplify=False, **attrs): + + if graph_type not in ['graph', 'digraph']: + raise Error, 'Invalid type. Accepted graph types are: graph, digraph, subgraph' + self.graph_type = graph_type + self.graph_name = graph_name + self.strict = strict + self.suppress_disconnected = suppress_disconnected + self.simplify = simplify + self.node_list = [] + self.edge_list = [] + self.edge_src_list = [] + self.edge_dst_list = [] + self.subgraph_list = [] + self.sorted_graph_elements = [] + self.parent_graph = self + for attr in self.attributes: + # Set all the attributes to None. + self.__setattr__(attr, None) + # Generate all the Setter methods. + self.__setattr__('set_'+attr, lambda x, a=attr : self.__setattr__(a, x)) + # Generate all the Getter methods. + self.__setattr__('get_'+attr, lambda a=attr : self.__get_attribute__(a)) + for attr, val in attrs.items(): + self.__setattr__(attr, val) + + def __getstate__(self): + + dict = copy.copy(self.__dict__) + for attr in self.attributes: + del dict['set_'+attr] + del dict['get_'+attr] + + return dict + + def __setstate__(self, state): + for k, v in state.items(): + self.__setattr__(k, v) + + def __get_attribute__(self, attr): + """Look for default attributes for this graph""" + attr_val = self.__getattribute__(attr) + if attr_val is None: + defaults = self.get_node('graph') + if defaults: + attr_val = defaults.__getattribute__(attr) + if attr_val: + return attr_val + else: + return attr_val + return None + + def set_simplify(self, simplify): + """Set whether to simplify or not. + + If True it will avoid displaying equal edges, i.e. + only one edge between two nodes. removing the + duplicated ones. + """ + + self.simplify = simplify + + def get_simplify(self): + """Get whether to simplify or not. + + Refer to set_simplify for more information. + """ + + return self.simplify + + + def set_type(self, graph_type): + """Set the graph's type, 'graph' or 'digraph'.""" + self.graph_type = graph_type + + def get_type(self): + """Get the graph's type, 'graph' or 'digraph'.""" + return self.graph_type + + def set_name(self, graph_name): + """Set the graph's name.""" + + self.graph_name = graph_name + + def get_name(self): + """Get the graph's name.""" + + return self.graph_name + + def set_strict(self, val): + """Set graph to 'strict' mode. + + This option is only valid for top level graphs. + """ + + self.strict = val + + def get_strict(self, val): + """Get graph's 'strict' mode (True, False). + + This option is only valid for top level graphs. + """ + + return self.strict + + def set_suppress_disconnected(self, val): + """Suppress disconnected nodes in the output graph. + + This option will skip nodes in the graph with no incoming or outgoing + edges. This option works also for subgraphs and has effect only in the + current graph/subgraph. + """ + + self.suppress_disconnected = val + + def get_suppress_disconnected(self, val): + """Get if suppress disconnected is set. + + Refer to set_suppress_disconnected for more information. + """ + + self.suppress_disconnected = val + + def set(self, name, value): + """Set an attribute value by name. + + Given an attribute 'name' it will set its value to 'value'. + There's always the possibility of using the methods: + + set_'name'(value) + + which are defined for all the existing attributes. + """ + if name in self.attributes: + self.__dict__[name] = value + return True + # Attribute is not known + return False + + def get(self, name): + """Get an attribute value by name. + + Given an attribute 'name' it will get its value. + There's always the possibility of using the methods: + + get_'name'() + + which are defined for all the existing attributes. + """ + return self.__dict__[name] + + def add_node(self, graph_node): + """Adds a node object to the graph. + + It takes a node object as its only argument and returns + None. + """ + + if not isinstance(graph_node, Node): + raise Error, 'add_node received a non node class object' + + node = self.get_node(graph_node.get_name()) + if node is None or graph_node.get_name() in ('graph', 'node', 'edge'): + self.node_list.append(graph_node) + graph_node.parent_graph = self.parent_graph + elif (node.__dict__.has_key('added_from_edge') and node.added_from_edge): + for k, v in graph_node.__dict__.items(): + if v is not None and node.__dict__.has_key(k) and node.__dict__[k] is None: + node.__dict__[k] = v + + self.sorted_graph_elements.append(graph_node) + + def get_node(self, name): + """Retrieved a node from the graph. + + Given a node's name the corresponding Node + instance will be returned. + + If multiple nodes exist with that name, a list of + Node instances is returned. + If only one node exists, the instance is returned. + None is returned otherwise. + """ + + match = [node for node in self.node_list if node.get_name() == str(name)] + + l = len(match) + if l==1: + return match[0] + elif l>1: + return match + else: + return None + + def get_node_list(self): + """Get the list of Node instances. + + This method returns the list of Node instances + composing the graph. + """ + + return [n for n in self.node_list if n.get_name() not in ('graph', 'edge', 'node')] + + def add_edge(self, graph_edge): + """Adds an edge object to the graph. + + It takes a edge object as its only argument and returns + None. + """ + + if not isinstance(graph_edge, Edge): + raise Error, 'add_edge received a non edge class object' + + self.edge_list.append(graph_edge) + + src = self.get_node(graph_edge.get_source()) + if src is None: + self.add_node(Node(graph_edge.get_source(), added_from_edge=True)) + + dst = self.get_node(graph_edge.get_destination()) + if dst is None: + self.add_node(Node(graph_edge.get_destination(), added_from_edge=True)) + + graph_edge.parent_graph = self.parent_graph + + if graph_edge.src not in self.edge_src_list: + self.edge_src_list.append(graph_edge.src) + + if graph_edge.dst not in self.edge_dst_list: + self.edge_dst_list.append(graph_edge.dst) + + self.sorted_graph_elements.append(graph_edge) + + def get_edge(self, src, dst): + """Retrieved an edge from the graph. + + Given an edge's source and destination the corresponding + Edge instance will be returned. + + If multiple edges exist with that source and destination, + a list of Edge instances is returned. + If only one edge exists, the instance is returned. + None is returned otherwise. + """ + + match = [edge for edge in self.edge_list if edge.src == src and edge.dst == dst] + + l = len(match) + if l==1: + return match[0] + elif l>1: + return match + else: + return None + + def get_edge_list(self): + """Get the list of Edge instances. + + This method returns the list of Edge instances + composing the graph. + """ + + return self.edge_list + + def add_subgraph(self, sgraph): + """Adds an edge object to the graph. + + It takes a subgraph object as its only argument and returns + None. + """ + if not isinstance(sgraph, Subgraph) and not isinstance(sgraph, Cluster): + raise Error, 'add_subgraph received a non subgraph class object' + + self.subgraph_list.append(sgraph) + + sgraph.set_graph_parent(self.parent_graph) + + self.sorted_graph_elements.append(sgraph) + + return None + + def get_subgraph(self, name): + """Retrieved a subgraph from the graph. + + Given a subgraph's name the corresponding + Subgraph instance will be returned. + + If multiple subgraphs exist with the same name, a list of + Subgraph instances is returned. + If only one Subgraph exists, the instance is returned. + None is returned otherwise. + """ + + match = [sgraph for sgraph in self.subgraph_list if sgraph.graph_name == name] + + l = len(match) + if l==1: + return match[0] + elif l>1: + return match + else: + return None + + def get_subgraph_list(self): + """Get the list of Subgraph instances. + + This method returns the list of Subgraph instances + in the graph. + """ + + return self.subgraph_list + + def set_graph_parent(self, parent): + """Sets a graph and its elements to point the the parent. + + Any subgraph added to a parent graph receives a reference + to the parent to access some common data. + """ + self.parent_graph = parent + + for elm in self.edge_list: + elm.parent_graph = parent + + for elm in self.node_list: + elm.parent_graph = parent + + for elm in self.subgraph_list: + elm.parent_graph = parent + elm.set_graph_parent(parent) + + def to_string(self): + """Returns a string representation of the graph in dot language. + + It will return the graph and all its subelements in string from. + """ + graph = '' + if self.__dict__.has_key('strict'): + if self==self.parent_graph and self.strict: + graph+='strict ' + + graph+=self.graph_type+' '+self.graph_name+' {\n' + + for attr in self.attributes: + if self.__dict__.has_key(attr) \ + and self.__getattribute__(attr) is not None: + graph += attr+'=' + val = str(self.__dict__[attr]) + if isinstance(val, str) and not self.is_ID(val): + graph += '"'+val+'"' + else: + graph += str(val) + graph+=';\n' + + + edges_done = [] + for elm in self.sorted_graph_elements: + if isinstance(elm, Node): + if self.suppress_disconnected: + if elm.name not in self.edge_src_list+self.edge_dst_list: + continue + graph += elm.to_string()+'\n' + elif isinstance(elm, Edge): + if self.simplify and elm in edges_done: + continue + graph += elm.to_string()+'\n' + edges_done.append(elm) + else: + graph += elm.to_string()+'\n' + + graph += '}\n' + + return graph + + +class Subgraph(Graph): + + """Class representing a subgraph in Graphviz's dot language. + + This class implements the methods to work on a representation + of a subgraph in Graphviz's dot language. + + subgraph(graph_name='subG', suppress_disconnected=False, attribute=value, ...) + + graph_name: + the subgraph's name + suppress_disconnected: + defaults to false, which will remove from the + subgraph any disconnected nodes. + All the attributes defined in the Graphviz dot language should + be supported. + + Attributes can be set through the dynamically generated methods: + + set_[attribute name], i.e. set_size, set_fontname + + or using the instance's attributes: + + Subgraph.[attribute name], i.e. + subgraph_instance.label, subgraph_instance.fontname + """ + + attributes = Graph.attributes + + # RMF: subgraph should have all the attributes of graph so it can be passed + # as a graph to all methods + def __init__(self, graph_name='subG', suppress_disconnected=False, \ + simplify=False, **attrs): + + self.graph_type = 'subgraph' + self.graph_name = graph_name + self.suppress_disconnected = suppress_disconnected + self.simplify = simplify + self.node_list = [] + self.edge_list = [] + self.edge_src_list = [] + self.edge_dst_list = [] + self.subgraph_list = [] + self.sorted_graph_elements = [] + for attr in self.attributes: + # Set all the attributes to None. + self.__setattr__(attr, None) + # Generate all the Setter methods. + self.__setattr__('set_'+attr, lambda x, a=attr : self.__setattr__(a, x)) + # Generate all the Getter methods. + self.__setattr__('get_'+attr, lambda a=attr : self.__get_attribute__(a)) + for attr, val in attrs.items(): + self.__setattr__(attr, val) + + def __getstate__(self): + + dict = copy.copy(self.__dict__) + for attr in self.attributes: + del dict['set_'+attr] + del dict['get_'+attr] + + return dict + + def __setstate__(self, state): + for k, v in state.items(): + self.__setattr__(k, v) + + def __get_attribute__(self, attr): + """Look for default attributes for this subgraph""" + attr_val = self.__getattribute__(attr) + if attr_val is None: + defaults = self.get_node('graph') + if defaults: + attr_val = defaults.__getattribute__(attr) + if attr_val: + return attr_val + else: + return attr_val + return None + + +class Cluster(Graph): + + """Class representing a cluster in Graphviz's dot language. + + This class implements the methods to work on a representation + of a cluster in Graphviz's dot language. + + cluster(graph_name='subG', suppress_disconnected=False, attribute=value, ...) + + graph_name: + the cluster's name (the string 'cluster' will be always prepended) + suppress_disconnected: + defaults to false, which will remove from the + cluster any disconnected nodes. + All the attributes defined in the Graphviz dot language should + be supported. + + Attributes can be set through the dynamically generated methods: + + set_[attribute name], i.e. set_color, set_fontname + + or using the instance's attributes: + + Cluster.[attribute name], i.e. + cluster_instance.color, cluster_instance.fontname + """ + + attributes = ['pencolor', 'bgcolor', 'labeljust', 'labelloc', 'URL', 'fontcolor', \ + 'fontsize', 'label', 'fontname', 'lp', 'style', 'target', 'color', \ + 'peripheries', 'fillcolor', 'nojustify'] + + def __init__(self, graph_name='subG', suppress_disconnected=False, \ + simplify=False, **attrs): + + #if type not in ['subgraph']: + # raise Error, 'Invalid type. Accepted graph types are: subgraph' + self.graph_type = 'subgraph' + self.graph_name = 'cluster_'+graph_name + self.suppress_disconnected = suppress_disconnected + self.simplify = simplify + self.node_list = [] + self.edge_list = [] + self.edge_src_list = [] + self.edge_dst_list = [] + self.subgraph_list = [] + self.sorted_graph_elements = [] + for attr in self.attributes: + # Set all the attributes to None. + self.__setattr__(attr, None) + # Generate all the Setter methods. + self.__setattr__('set_'+attr, lambda x, a=attr : self.__setattr__(a, x)) + # Generate all the Getter methods. + self.__setattr__('get_'+attr, lambda a=attr : self.__get_attribute__(a)) + for attr, val in attrs.items(): + self.__setattr__(attr, val) + + def __getstate__(self): + + dict = copy.copy(self.__dict__) + for attr in self.attributes: + del dict['set_'+attr] + del dict['get_'+attr] + + return dict + + def __setstate__(self, state): + for k, v in state.items(): + self.__setattr__(k, v) + + def __get_attribute__(self, attr): + """Look for default attributes for this cluster""" + attr_val = self.__getattribute__(attr) + if attr_val is None: + defaults = self.get_node('graph') + if defaults: + attr_val = defaults.__getattribute__(attr) + if attr_val: + return attr_val + else: + return attr_val + return None + + +class Dot(Graph): + """A container for handling a dot language file. + + This class implements methods to write and process + a dot language file. It is a derived class of + the base class 'Graph'. + """ + + progs = None + + formats = ['ps', 'ps2', 'hpgl', 'pcl', 'mif', 'pic', 'gd', 'gd2', 'gif', 'jpg', \ + 'jpeg', 'png', 'wbmp', 'ismap', 'imap', 'cmap', 'cmapx', 'vrml', 'vtx', 'mp', \ + 'fig', 'svg', 'svgz', 'dia', 'dot', 'canon', 'plain', 'plain-ext', 'xdot'] + + def __init__(self, prog='dot', **args): + Graph.__init__(self, **args) + + self.prog = prog + + # Automatically creates all the methods enabling the creation + # of output in any of the supported formats. + for frmt in self.formats: + self.__setattr__('create_'+frmt, lambda f=frmt, prog=self.prog : self.create(format=f, prog=prog)) + f = self.__dict__['create_'+frmt] + f.__doc__ = '''Refer to docstring from 'create' for more information.''' + + for frmt in self.formats+['raw']: + self.__setattr__('write_'+frmt, lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog)) + f = self.__dict__['write_'+frmt] + f.__doc__ = '''Refer to docstring from 'write' for more information.''' + + + def __getstate__(self): + + dict = copy.copy(self.__dict__) + for attr in self.attributes: + del dict['set_'+attr] + del dict['get_'+attr] + + for k in [x for x in dict.keys() if x.startswith('write_')] + \ + [x for x in dict.keys() if x.startswith('create_')]: + del dict[k] + + return dict + + def __setstate__(self, state): + self.__init__() + for k, v in state.items(): + self.__setattr__(k, v) + + + def set_prog(self, prog): + """Sets the default program. + + Sets the default program in charge of processing + the dot file into a graph. + """ + self.prog = prog + + def write(self, path, prog=None, format='raw'): + """Writes a graph to a file. + + Given a filename 'path' it will open/create and truncate + such file and write on it a representation of the graph + defined by the dot object and in the format specified by + 'format'. + The format 'raw' is used to dump the string representation + of the Dot object, without further processing. + The output can be processed by any of graphviz tools, defined + in 'prog', which defaults to 'dot' + Returns True or False according to the success of the write + operation. + + There's also the preferred possibility of using: + + write_'format'(path, prog='program') + + which are automatically defined for all the supported formats. + [write_ps(), write_gif(), write_dia(), ...] + """ + + if prog is None: + prog = self.prog + + dot_fd = file(path, "w+b") + if format == 'raw': + dot_fd.write(self.to_string()) + else: + dot_fd.write(self.create(prog, format)) + dot_fd.close() + + return True + + def create(self, prog=None, format='ps'): + """Creates and returns a Postscript representation of the graph. + + create will write the graph to a temporary dot file and process + it with the program given by 'prog' (which defaults to 'twopi'), + reading the Postscript output and returning it as a string is the + operation is successful. + On failure None is returned. + + There's also the preferred possibility of using: + + create_'format'(prog='program') + + which are automatically defined for all the supported formats. + [create_ps(), create_gif(), create_dia(), ...] + """ + if prog is None: + prog = self.prog + + if self.progs is None: + self.progs = find_graphviz() + if self.progs is None: + return None + if not self.progs.has_key(prog): + # Program not found ?!?! + return None + + tmp_fd, tmp_name = tempfile.mkstemp() + os.close(tmp_fd) + self.write(tmp_name) + stdin, stdout, stderr = os.popen3(self.progs[prog]+' -T'+format+' '+tmp_name, 'b') + stdin.close() + stderr.close() + data = stdout.read() + stdout.close() + os.unlink(tmp_name) + return data + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-08 19:53:21
|
Revision: 99 http://roreditor.svn.sourceforge.net/roreditor/?rev=99&view=rev Author: rorthomas Date: 2007-07-08 12:53:20 -0700 (Sun, 08 Jul 2007) Log Message: ----------- * added error prevention to svn update Modified Paths: -------------- trunk/lib/ror/starter.py trunk/lib/ror/svn.py Modified: trunk/lib/ror/starter.py =================================================================== --- trunk/lib/ror/starter.py 2007-07-08 19:13:57 UTC (rev 98) +++ trunk/lib/ror/starter.py 2007-07-08 19:53:20 UTC (rev 99) @@ -117,7 +117,7 @@ f.close() def OnDepGraph(self, event=None): - dlg = wx.MessageDialog(self, "to get this working, you must install tools/pyparsing*.exe and tools/graphviz*.exe!", "Info", wx.OK | wx.ICON_INFORMATION) + dlg = wx.MessageDialog(self, "to get this working, you must install tools/pyparsing*.exe and tools/graphviz*.exe (relative to the installation directory)!", "Info", wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() dlg.Destroy() from depchecker import * Modified: trunk/lib/ror/svn.py =================================================================== --- trunk/lib/ror/svn.py 2007-07-08 19:13:57 UTC (rev 98) +++ trunk/lib/ror/svn.py 2007-07-08 19:53:20 UTC (rev 99) @@ -77,6 +77,11 @@ changes = 0 try: client = pysvn.Client() + + # try to restore previous broken updates + client.unlock(path) + client.cleanup(path) + revision_before = getRevision(client, path) print "updating from revision %d ..." % revision_before if callback is None: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-08 19:13:58
|
Revision: 98 http://roreditor.svn.sourceforge.net/roreditor/?rev=98&view=rev Author: rorthomas Date: 2007-07-08 12:13:57 -0700 (Sun, 08 Jul 2007) Log Message: ----------- * added missing file :-\ Added Paths: ----------- trunk/lib/ror/depcheckerplugins/deptools.py Added: trunk/lib/ror/depcheckerplugins/deptools.py =================================================================== --- trunk/lib/ror/depcheckerplugins/deptools.py (rev 0) +++ trunk/lib/ror/depcheckerplugins/deptools.py 2007-07-08 19:13:57 UTC (rev 98) @@ -0,0 +1,12 @@ +#Thomas Fischer 06/07/2007, th...@th... +import sys, os, os.path + +REQUIRES = 'requires' +OPTIONAL = 'optional' +PROVIDES = 'provides' +REQUIREDBY = 'requiredby' +RELATIONS = [REQUIRES, PROVIDES, OPTIONAL, REQUIREDBY] + +MATERIAL = 'material' +FILE = 'file' +TYPES = [MATERIAL, FILE] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-08 19:09:34
|
Revision: 97 http://roreditor.svn.sourceforge.net/roreditor/?rev=97&view=rev Author: rorthomas Date: 2007-07-08 12:09:32 -0700 (Sun, 08 Jul 2007) Log Message: ----------- * minor corrections Modified Paths: -------------- trunk/lib/ror/depchecker.py trunk/lib/ror/starter.py trunk/lib/ror/svngui.py Modified: trunk/lib/ror/depchecker.py =================================================================== --- trunk/lib/ror/depchecker.py 2007-07-08 19:01:38 UTC (rev 96) +++ trunk/lib/ror/depchecker.py 2007-07-08 19:09:32 UTC (rev 97) @@ -3,6 +3,7 @@ DEPCHECKPATH = "depcheckerplugins" sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), DEPCHECKPATH)) +print os.path.join(os.path.dirname(os.path.abspath(__file__)), DEPCHECKPATH) from deptools import * REMOVE_UNUSED_MATERIALS = True Modified: trunk/lib/ror/starter.py =================================================================== --- trunk/lib/ror/starter.py 2007-07-08 19:01:38 UTC (rev 96) +++ trunk/lib/ror/starter.py 2007-07-08 19:09:32 UTC (rev 97) @@ -120,9 +120,9 @@ dlg = wx.MessageDialog(self, "to get this working, you must install tools/pyparsing*.exe and tools/graphviz*.exe!", "Info", wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() dlg.Destroy() - import depchecker - depchecker.RoRDepChecker(self.rordir, "all", "") - dlg = wx.MessageDialog(self, "If everything went fine (and you got the correct tools installed), you should find the graph in the RoRToolkit Directory under dependencies.png!", "Info", wx.OK | wx.ICON_INFORMATION) + from depchecker import * + RoRDepChecker(self.rordir, "all", "") + dlg = wx.MessageDialog(self, "If everything went fine (and you got the correct tools installed), you should find the graph in the RoRToolkit Directory under dependencies.png!\n it is best viewed in firefox.\nred means missing/nout found.", "Info", wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() dlg.Destroy() Modified: trunk/lib/ror/svngui.py =================================================================== --- trunk/lib/ror/svngui.py 2007-07-08 19:01:38 UTC (rev 96) +++ trunk/lib/ror/svngui.py 2007-07-08 19:09:32 UTC (rev 97) @@ -41,7 +41,7 @@ def notify(self, event_dict): self.changes += 1 - msg = str(event_dict['action']) + ", " + event_dict['path'] + msg = str(event_dict['action']) + ", " + os.path.basename(event_dict['path']) #self.pr.Update(self.changes % 100, msg) self.pr.Pulse(msg) \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-08 19:01:39
|
Revision: 96 http://roreditor.svn.sourceforge.net/roreditor/?rev=96&view=rev Author: rorthomas Date: 2007-07-08 12:01:38 -0700 (Sun, 08 Jul 2007) Log Message: ----------- * minor corrections Modified Paths: -------------- trunk/lib/ror/starter.py Modified: trunk/lib/ror/starter.py =================================================================== --- trunk/lib/ror/starter.py 2007-07-08 19:01:11 UTC (rev 95) +++ trunk/lib/ror/starter.py 2007-07-08 19:01:38 UTC (rev 96) @@ -117,9 +117,12 @@ f.close() def OnDepGraph(self, event=None): + dlg = wx.MessageDialog(self, "to get this working, you must install tools/pyparsing*.exe and tools/graphviz*.exe!", "Info", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() import depchecker depchecker.RoRDepChecker(self.rordir, "all", "") - dlg = wx.MessageDialog(self, "If everything went fine, you should find the graph in the RoRToolkit Directory under dependencies.png!", "Info", wx.OK | wx.ICON_INFORMATION) + dlg = wx.MessageDialog(self, "If everything went fine (and you got the correct tools installed), you should find the graph in the RoRToolkit Directory under dependencies.png!", "Info", wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() dlg.Destroy() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-08 19:01:13
|
Revision: 95 http://roreditor.svn.sourceforge.net/roreditor/?rev=95&view=rev Author: rorthomas Date: 2007-07-08 12:01:11 -0700 (Sun, 08 Jul 2007) Log Message: ----------- * added optional tools Added Paths: ----------- trunk/tools/graphviz-2.12.exe trunk/tools/pyparsing-1.4.6.win32.exe Added: trunk/tools/graphviz-2.12.exe =================================================================== (Binary files differ) Property changes on: trunk/tools/graphviz-2.12.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/tools/pyparsing-1.4.6.win32.exe =================================================================== (Binary files differ) Property changes on: trunk/tools/pyparsing-1.4.6.win32.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-08 18:57:28
|
Revision: 94 http://roreditor.svn.sourceforge.net/roreditor/?rev=94&view=rev Author: rorthomas Date: 2007-07-08 11:57:27 -0700 (Sun, 08 Jul 2007) Log Message: ----------- * added graph tool to starter menu Modified Paths: -------------- trunk/lib/ror/depchecker.py trunk/lib/ror/starter.py Modified: trunk/lib/ror/depchecker.py =================================================================== --- trunk/lib/ror/depchecker.py 2007-07-08 04:31:12 UTC (rev 93) +++ trunk/lib/ror/depchecker.py 2007-07-08 18:57:27 UTC (rev 94) @@ -7,8 +7,9 @@ REMOVE_UNUSED_MATERIALS = True +MD5FILENAME = "031amd5.txt" #0.31a md5 .txt +MD5FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), MD5FILENAME) - class RoRDepChecker: def __init__(self, path, mode, dependfilename): self.filedeps = {} @@ -28,33 +29,65 @@ self.generateCrossDep() if dependfilename != "": self.generateSingleDep() - #self.tryGraph() + self.tryGraph() def savemd5(self): lines = [] for fn in self.files.keys(): lines.append(os.path.basename(fn)+" "+self.files[fn]['md5']+"\n") - f=open("md5sums.txt", 'w') + f=open(MD5FILE, 'w') f.writelines(lines) f.close() def getSingleDepRecursive(self, filename, depth = 0): file = self.filedeps[filename] - req = [[depth, filename]] + req = [{'depth':depth, 'filename':filename}] #print file for r in file[REQUIRES][FILE]: try: for rr in self.getSingleDepRecursive(r, depth + 1): duplicate = False - for a in req: - if rr[1] in a: + for rsub in req: + if rr['filename'] == rsub['filename']: duplicate = True if not duplicate: - req.append([rr[0], rr[1]]) + req.append(rr) except: pass return req + + def generateSingleDep(self): + if not self.dependfilename in self.filedeps.keys(): + print "file not found in the dependency tree!" + sys.exit(0) + tree = self.getSingleDepRecursive(self.dependfilename) + #print tree + for t in tree: + t['fullpath'] = self.getFullPath(t['filename']) + t['md5sum'] = self.md5Sum(t['fullpath']) + print "%-30s %-30s" % ("+"*t['depth']+t['filename'], t['md5sum']) + #self.removeOriginalFilesFromSingleDep + #for f in self.filedeps.keys(): + # print str(self.filedeps[f][REQUIRES]) + # print str(self.filedeps[f][REQUIREDBY]) + # print "---------------------------------" + self.tryGraph(tree) + def removeOriginalFilesFromSingleDep(self, tree): + self.readMD5File() + + + + def readMD5File(self): + md5s = {} + f=open(MD5FILE, 'r') + content = f.readlines() + f.close() + for line in content: + l = line.split(" ") + md5s[l[0]] = l[1] + self.orgMD5s = md5s + def readFile(self, filename): f=open(filename, 'rb') content = f.read() @@ -68,73 +101,63 @@ except: return return md5.new(content).hexdigest() - - def generateSingleDep(self): - if not self.dependfilename in self.filedeps.keys(): - print "file not found in the dependency tree!" - sys.exit(0) - tree = self.getSingleDepRecursive(self.dependfilename) - for t in tree: - t.append(self.getFullPath(t[1])) - for t in tree: - t.append(self.md5Sum(t[2])) - for t in tree: - print "%-60s %-30s" % ("+"*t[0]+t[2], t[3]) - #for f in self.filedeps.keys(): - # print str(self.filedeps[f][REQUIRES]) - # print str(self.filedeps[f][REQUIREDBY]) - # print "---------------------------------" - - def tryGraph(self): + def tryGraph(self, tree = None): try: import pydot print "pydot found, drawing graphs! beware this can take some time with big graphs!" - self.drawGraph() + self.drawGraph(tree) except ImportError: print "pydot not found, not drawing graphs" pass - def drawGraph(self): + def drawGraph(self, tree = None): import pydot edges = [] - for filenameA in self.filedeps.keys(): - fileA = self.filedeps[filenameA] - for rel in fileA[REQUIRES][FILE]: - e = (filenameA, rel) - edges.append(e) + if tree is None: + for filenameA in self.filedeps.keys(): + fileA = self.filedeps[filenameA] + for rel in fileA[REQUIRES][FILE]: + e = (filenameA, rel) + edges.append(e) + else: + pass #edges = [(1,2), (1,3), (1,4), (3,4)] graph = pydot.graph_from_edges(edges) graph.set_type('digraph') graph.simplify = True #graph.set("resolution", "320") - graph.set("overlap", "0") + #graph.set("overlap", "0") #graph.set("shape", "box") for n in graph.get_node_list(): n.set('fontsize', 8) n.set('style', 'filled') onlyfilename, ext = os.path.splitext(n.get_name()) - if ext == ".truck": - n.set('fillcolor', 'gold') - elif ext == ".load": - n.set('fillcolor', 'lightyellow') - elif ext == ".material": - n.set('fillcolor', 'lightseagreen') - elif ext == ".mesh": - n.set('fillcolor', 'lightsalmon') - elif ext == ".png" or ext == ".jpg" or ext == ".bmp": - n.set('fillcolor', 'lightblue') + fp = self.getFullPath(n.get_name()) + if fp is None: + n.set('fillcolor', 'red') + else: + if ext == ".truck": + n.set('fillcolor', 'gold') + elif ext == ".load": + n.set('fillcolor', 'lightyellow') + elif ext == ".material": + n.set('fillcolor', 'lightseagreen') + elif ext == ".mesh": + n.set('fillcolor', 'lightsalmon') + elif ext == ".png" or ext == ".jpg" or ext == ".bmp": + n.set('fillcolor', 'lightblue') program = "dot" # dot or twopi - if len(self.filedeps) > 100: - program = "twopi" + #if len(self.filedeps) > 100: + # program = "twopi" - graph.write('dependencies.jpg', prog = program, format='jpeg') - print "graph successfull written to dependencies.jpg" + graph.write('dependencies.png', prog = program, format='png') + print "graph successfull written to dependencies.png" def generateCrossDep(self): @@ -217,6 +240,7 @@ for f in self.files: if os.path.basename(f) == filename: return f + return None def getfiles(self, md5 = False): fl = {} Modified: trunk/lib/ror/starter.py =================================================================== --- trunk/lib/ror/starter.py 2007-07-08 04:31:12 UTC (rev 93) +++ trunk/lib/ror/starter.py 2007-07-08 18:57:27 UTC (rev 94) @@ -60,6 +60,9 @@ self.btnUpdate = wx.Button(self.panel, wx.ID_ANY, "Update") self.Bind(wx.EVT_BUTTON, self.OnUpdate, self.btnUpdate) + self.btnDepGraph = wx.Button(self.panel, wx.ID_ANY, "Create dependency Graph") + self.Bind(wx.EVT_BUTTON, self.OnDepGraph, self.btnDepGraph) + self.btnExit = wx.Button(self.panel, wx.ID_ANY, "Exit") self.Bind(wx.EVT_BUTTON, self.OnExit, self.btnExit) @@ -113,6 +116,13 @@ f.writelines(content) f.close() + def OnDepGraph(self, event=None): + import depchecker + depchecker.RoRDepChecker(self.rordir, "all", "") + dlg = wx.MessageDialog(self, "If everything went fine, you should find the graph in the RoRToolkit Directory under dependencies.png!", "Info", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + def OnUpdate(self, event=None): import svngui gui = svngui.svnUpdate() @@ -223,6 +233,7 @@ sizer_panel.Add(self.btnStartTruckEditor, 0, wx.EXPAND, 0) sizer_panel.Add(self.btnBugReport, 0, wx.EXPAND, 0) sizer_panel.Add(self.btnUpdate, 0, wx.EXPAND, 0) + sizer_panel.Add(self.btnDepGraph, 0, wx.EXPAND, 0) sizer_panel.Add(self.btnExit, 0, wx.EXPAND, 0) self.panel.SetSizer(sizer_panel) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-08 04:31:14
|
Revision: 93 http://roreditor.svn.sourceforge.net/roreditor/?rev=93&view=rev Author: rorthomas Date: 2007-07-07 21:31:12 -0700 (Sat, 07 Jul 2007) Log Message: ----------- minors Modified Paths: -------------- trunk/lib/ror/depchecker.py Added Paths: ----------- trunk/lib/ror/031amd5.txt Added: trunk/lib/ror/031amd5.txt =================================================================== --- trunk/lib/ror/031amd5.txt (rev 0) +++ trunk/lib/ror/031amd5.txt 2007-07-08 04:31:12 UTC (rev 93) @@ -0,0 +1,593 @@ +island.cfg 37a53a2d0719b48b09b3c0f830cddf6d +radiobox.png b38ecc8fb5ad75e016797fbf783bee59 +RenderSystem_Direct3D9.dll 4aaf585c9496bfacde549f08c1b669a1 +nhelens-0h.jpg 23c5a7a87c973a7857faf2418b4f33fc +semi.truck e19d61fed92db367d44ca994ad7773e4 +derooyrwheelface.png f1f0f5ae9417e286e3b7cafb6c5694ea +road-runway-middle.mesh 0c46c887a71e2aafa6b6fe1e4229026d +hangardoor.png 93dbedc7727003affe6d1759b02a43e7 +road-slab.odef db9d63cb14af62a282effd4e7b2dd551 +sign-dir-cold-cast.mesh 26fa62bd0593ade544f7153383503f34 +nhelens-10h.jpg eea130e8288935b349297c8260eaa5d5 +C1.material 12d5857656ebe02add37d9a003ea26de +caliber.png 9ffc3ecf5f2a57078f315f18c7902ac4 +road-block1.mesh a4a6cda330df47b225be5d11d9b34506 +OgrePlatform.dll 7c21a81989c77606a1cf157c87c911ec +nhelens.jpg 8493beabc36ab508ec07759c7549ad4b +medium.wav 5b73153687162a2f755c63c36b25c495 +clutch-off.png dfe0cfbd49cb38aad2221f311b1c7ee4 +dodgepolice.truck e62bf2e727d3ff76a00d64597604ad32 +redbeaconflare.png 3d642eed8572431d87d994749f6131d3 +brake.wav 4a2094702d668c35d2d2dad01fb55431 +flatdaf-mini.png 9b7c8523e710d2a64e9fb0eaf10d433d +AE86.truck e937c93f69561ea8feec51b945d1a79c +3d_dashboard.material 795811d8468bbd73e23d3972389e968d +Blur_ps.glsl 223dbbe3de3343a78843013dc768bb45 +bluehouse.png d63c4321a3b532a575e9a1f3efead4b0 +zlib1.dll 3ecfe1baeab591769664567c4e653e6f +ttwinwheelband.png aff73861aa1028f5559766dae1466f98 +nhelens-7h.jpg ba5a226dd3fa6ecf83bd26f7f27fb231 +myhangar2.png d16b03c89cb60d641f2d60a40bdaefb5 +Plugin_ParticleFX.dll 1f4bfae8ab97b3b9bc292aa90ac9c57a +dashbar.png 62bd47c4ff9f6ccdee23574a5b292c0c +whiteobs.png ac5106827190a4dce79bff3b48e50dca +altimeter.png 551b2689c287f03ccdc4340b070caf21 +road-park.odef dd2f5a727eb9e5950c062b87e16c375a +nhelens-16h.jpg 3d3a9a632df98fc14f563882ec055139 +aspen-11h.jpg 0dc2abfa83940f41512b5ba1493283c8 +redbeacon.mesh e60e53960fbbe0c801b989c7703ace06 +Sunburn.material 381a87a3190874d7a8fb809a8c803926 +ampliroll.png f4555711f56826739f3f18e29adeb65b +C1.jpg 446e4959501900381876fc64cc8adc07 +chapel.material f07b66c106b5bd471acf500f52efce74 +prop.png 985161fbf152125a9daeb4fed297d8a4 +sign-rightturn.png 32524dc2dc4592a40f2ac1885249b96c +hornstop.wav 65acfa9613af805b8d936584cdbc53aa +aspen-17h.jpg 2b70e06566307f2bcd90bc9624e478d5 +multibenne.material ec572a0ec17ee23e8abd807f36a2ce0b +an12fairing-right.mesh 9f6b1fe8e3f1fe705c996b3939386f27 +Blur0_ps20.hlsl db9d527f2bee3989a5cff0d5d57517b4 +ampliroll_emissive.png 0c9fcab3c70fbf26c10039795da12f96 +road-block2.mesh 7a87837a27fa34709c40e28a9a7ef308 +flatdaf.truck 7a1bdcf3a1b2f89b0837c84e4e37576a +dafrwheelface.png f1f0f5ae9417e286e3b7cafb6c5694ea +dafwheelband.png 787aa1bbe2dbbfaff3f10ab9fb5becb9 +pbrake-on.png dc1798a002350c56c152f7cde9b229d5 +C1.truck 9b8ec7c71f4586d9c1c94cfd9c1828b3 +myobs.odef a6303e4e703e9e77f515fde800394e95 +Example_Fresnel.cg 1a3e69c7dea2e5d83cde299c27e54b2a +ae86wheelband.png 7564991a91a23beaf12a32a12603e232 +road-slab1.odef ec1713d49079f07eb8db82fbc444dad7 +road-slab2.mesh 2e39890bf442f338000b839b84db19bc +seat.mesh 21f4da10514233acf7bba1da9a5a6ab2 +nhelens-9h.jpg f97146588397cac7e46c164132d25479 +wheelprop.mesh d318ead34b5b1601c33dfbcf8be34508 +Plugin_CgProgramManager.dll 8e7e6b2068d1c5ab15a92bba87885356 +sign-rocks.mesh bae37b68c00885d07f673fc288251566 +redneedle.png ca0eadf0510fef288ecf65b2200a78db +ampliroll.material 943aa619b194cff2f1afbae48feebedb +OpenAL32.dll 989a44283a84ac1b99aeff5bf7461af4 +agoras.truck 0c233e955805c5382b5da831613df9fc +sign-bump.odef 5ec21719c7fb30f27668f734f6e23903 +island-8h.jpg 4d4177686bf73b4ec9e65a19c90b97fd +beaconflare.png 16db5138f7e2ca552017a924a1fefb46 +force.wav a9079ad3d8725e69b9d7568b351e02f7 +3d_dashboard_needles.overlay 931ab010667ef8f49ae9aac15e669e41 +lab.mesh 8ab560df1552941ef8c6ac05f200bef0 +roadborderright.odef 6fa1ad42f94205012894125a80c9c2a0 +beam.mesh eca5570b2469fa187c973d3ce29816a2 +horn.wav 5f4306d681e8ddf42d82caedac0b5414 +flatdaf.material bf0af31dcf7fb683f6dfea6d365074ce +sign-pos-coldwater.mesh 9b5e6f2c9387a9318b1b15681e7cfb3d +hangardoor.mesh 9b3d3f7bf5e7fba4df30c415f1e13823 +liebherrwheelface.png 53b690fb4fee71500ac48d7db973fbf4 +ttwinwheelface.png efc95e640f053bf567a79929a397d571 +hydrostop.wav 9cc492e5d659b6566722430fc9b96f50 +pedal.png dbc4ae080ab06aa842068401b97b4fa5 +turbotwin.png 3999c3a4899af0cd03913907ff7652e4 +NACA64.1.412.afl f13e1c53e367408d1a94d1170f588dc3 +sign-fall.mesh afdbdb13f422ceace941d1283a17419d +road-street.odef bff7bd13c1191d1c7ef096325e65b6be +resources.cfg 241ca437b1f011c9ccf348744cdba784 +terrain_detail-old.jpg 7e5db3060401496bf132b053b14a0164 +smallhouse.jpg ec02be41f096d2423aef4c0c0af7808e +island-12h.jpg 9a8bb1ff4ccf632a9709b63d1729144c +aspen.jpg 40c45d418c8aef5d815a42504bd32448 +road-tee.odef 3db7a7fab4e619c5f37abe1318228f64 +boxtrailer.load 73506570bd504a8a91a62b6b85ebaed8 +park.wav bb53d3e7593f40d0941c89e3357d19b3 +Toyota86mat.material cbace6f1e3194b5ad069d0d877f5679f +SkyLightAbsorption.cg 574861cf4f49b8655748a41c7150c3d0 +needles.overlay 288cc87dbf4a6ef08441d41d7a3b1db6 +EarthClearSkyFog.png 6c21d661362c53f330473932b5979cde +credits.overlay 73d074f6aeaf4b2e108ee43db310bfa3 +t813.truck 677757582710bd4183aea082bee6a153 +starter.wav 6d01bf908c2ce0341e901787f83c0083 +tatrawheelband.png 03699cb787c9846adf10ae22e221f3d5 +Clark-Y.afl f0a11aa827713846d8e0d78d84c830bb +dust.png 94a08ca544b36c30db3b49c6a09f314d +truckshop.material b5fa3ec6b15fb8c5440245b9043ac1d0 +beacon.mesh 6d1fb3ba01a4f80c6875112b468685e7 +island.raw e0634004e84955b700500e29f8f04f89 +batt-off.png 74cfde1867fa7f2193b060a847fd2f19 +lights-on.png b2d58b7dfdae5e216a0ee8c920c45516 +multibenne.truck 75d431f8f9e01e26d2dad44bab0aa39f +road-runway-middle.odef 3c67e9848ab4dac5c81c6e36905a77a8 +dashboard.material dd3f2236e2097ac6abb13f4343ccc89a +sphere.mesh 0b2ac7cac218e5f24e9197eb02c11fbe +nedlloyd.png 83d18bc6286ff871470c878e0b734d94 +various.overlay a55fb31dd39c5b27174704689275d0d8 +sign-warning.odef a24135cfa049abc07e90392e6d839399 +tunapicker.odef ef4ce499dea41d9b655245fef4ddfa06 +road-park.mesh a1c5f3d5cc983858a5ca96aa48bcd2b6 +lights-off.png 0481f6ca97671546cb05498d4da64a70 +semi.material 99050dca1caae729464f1838e5d824eb +agoras-mini.png ee18c0ce303430929ad14ff861023e9a +low.wav 93e0ef2a558ddb2c95b229578d5556cf +roadquay.mesh 8bdfba2e2408bac95072b1491042df03 +radiochecked.png 7e61aceaf416883dc1b5bab8f6b1c29b +roadborderright.mesh 8f24b09e15dde7615540f484b47cbfc2 +sign-fall.odef fce809fab7640b58a0230b397b2626db +multibenne_emissive.png b6393085104d0ced9cbe8002437ad85c +selectbeamicon.png d5955cceb6e766c5d2a36678eb871a44 +turbotwin.truck 6899663ed025b9bde4dfa11df7514c1d +sign-dir-stud-cast.mesh d174faa705b0897ac9bf790a3c44e315 +stand2.material 8d74154173d7dc53bb8295773f1c77c5 +high.wav cc2c993691a47efc01446102a9bf11e7 +aoa.png 6274f1d41d36dcaaed401558efaa7fa3 +creak.wav 93e79a6e535b80ea40607f0967bb6f4a +MotionBlur.material 2db7237d3269c943a25290cd0fd78e60 +EarthClearSky.psd 1ebb8c9577fc3ae9f5233c2e2edf75d4 +challenger.truck 7500c9f94709b88e07c2e45873e18b6d +wahoo-mini.png da90fa94262f5ebcdbd50e0d606444bc +daf.material c666f397bfc203d052883527a8e99c0b +sign-dir-john-cast.mesh e6c0c987c34303ac20f8e8ca589945e3 +nedlloyd.mesh d44ec959aa879b3fc09bd1c0e682f1ba +airrpm.png b61525c9a9cd3e532d70e4561b7d7716 +batt-on.png 83baeb768cb7a418c0a298a4cd06b5b7 +sign-rocks.odef df8a31edff53df3e86388de40f789f15 +clutch-on.png acb83ccc810cdad35db7d84c6efe741f +mirror.png 294365f3f71136d66fb6974293cfa210 +wrap_oal.dll 8ada06c5270912b4a383815f5be1e669 +liebherr.png 06461ddd6502e7390520ec5e6b90ef69 +agora.material 068b06a3e805232da0cab7e7c8cc813a +road-slab1.mesh 89187c0520b23b4fdc44e5cc8b04f787 +nedlloyd.material 7381446c0b5760957543986a59a68d57 +valve.wav d29298d7ea956e4a9630128a68dfccee +Scanialoader-mini.png 6132949e5c78ae792635e4f8c3dbbdc3 +caliberwheelface.jpg 3d70dc502844bc44208e46aad72fad1a +aspen-16h.jpg 9f159daf78ef5232d45bb500a7471b4f +OgreCore.zip 81fb5297b956144790991d1797e3c164 +smallhouse.material cfdfcb924610c59242315da4b04b2d4c +turbotwin_emissive.png 49a4cbbc36d2c8325477401e88ae2be1 +chapel.mesh 84a665990f33935e9c45e13285cbcf05 +crate.load 6ec00209f51e0eca2af3543a059afc8b +SideBar.material 9ab896eba1ae1c9d9f16cdfb3ceffab7 +moveicon.png d624c9f15df535c3739777b18a59ad1a +barge.load 8248d4e193173113fe326b240efad149 +fl6-volvo-plain.png d4de976691ff5ba7343092a153e43c81 +island-9h.jpg 6070b2d9b3cdc484085571e419975082 +dashboard.png 4f2a70dcbfd9ff25b738a2c4561f064d +rollmaskblink.png f02b021938181a3aeaa1f443502da3e4 +redflare.png f9bc8f90ad7412c6294087f0460ff97f +dodge-police.png 0d6804d55bfded6999a08b98f3dafbd4 +renault-mini.png a8149f703f6e524bb760229d3829f490 +SideBar.mesh 30f8d1bca35049704ab483e9942e32f1 +checksemichecked.png b9f5c3eaa0879d029db047eca5dd8e84 +spinprop.mesh 82b1bab48e75af7631b6eba97decad20 +perlinvolume.dds 858c9694bff2f8bf0f3ee5eb8b9c64d8 +challenger-emissive.png 8c15a566f5b5ec1c07fa0c635799a13b +aflatbed.png 4137c8f9e732f06fe827c0351379a2eb +myhangar2.mesh e6cdfda0cc6783dca0af2425e132d268 +airpitch.png 7f1e5ad3f77e1744b6b01d898d6151b8 +aspen.raw 4cb4846fa0c9a12a9c24005df27fc31f +Bloom_vs11.hlsl c0b803f5a31b9a3b05c9d59c9971248c +island-7h.jpg 1097347fc1e02c81e12c105875da7b4a +wheelface.jpg 8ef91d77e0c2cf4e1bd5f13a041d8474 +aspen-10h.jpg 0bd918b9e0a433ca23f4bbab1da107ab +selecticon.png a75129ffd2e6f51dce0ef5f9ff61133d +fl6-volvo.truck 729dd02d2c82e52f978eff3eaaa8c02e +pitchmask.png 77823edcf06dddd761060653aa26dddf +water.jpg 6ab7d0026eae80ccf67c9cc76b06ee0d +an12nacelle.mesh 8b8fb48fc5c3060fe7d663e5c54cbb1f +schoolbus.material cd3d24320eaeddc19c830ede1dcf0bb4 +aflatbed.load ec03ff2a0753e6baeb289cfff470e749 +leftmirror.mesh 06d73ca36841163b78054bffd5cbe379 +amplirollhelp.png ce5b315492f916c6cdbd9c6a7ce88be7 +up.png 6ec03028e96a37b1e3cf497714f685ae +aspen-13h.jpg 22399090ecb1e8b271608730249c9fc2 +wavefield.cfg cb565e34b61f884b86668f9798899a31 +down.png 61112131e2ea91ffe342ca1531c31b0d +sign-rightturn.mesh e959492837595d1c986e365ed6e14e17 +splash.png 1405ce9c2268ba672d014d9caf547f38 +semi.png 0ef678c13085287e2dcf51c8a5d1c12e +terrain_detail.jpg f97414a90fc9767ba659949881445c0e +sign-pos-coldwater.odef 5ed8f023ed2af76b07e030b257144d84 +turbo.wav 5fd594864e3a74fabfd4bf015ace7b18 +starterstop.wav ad5726129b9d0b7c9a671a3b8a4232ec +road-taxiway.mesh d16fffd5e6c189382936cb68db4f89d0 +chp.material e14dc544e62989297298f90d37f2ed2a +fl6-volvo.png fdf16fec7432674145314055a8347fb4 +wrecker.material e2e4be1fef46c755a55c489047cc4c51 +sign-warning.mesh 965d17be21820230042abbd4d3df987a +credits.png faff03e4936acea81c8dd474a3d57e43 +iddle.wav 051f8e44c3bb537fb85316ad42344042 +wahoo.truck e15de7a6140abdaff438a8b68cc27e70 +robot.mesh 66abc6387e9096cb121983ea30ef1bd1 +liebherrhelp.png 5f068587627cff646134a0e6bc123ab4 +road-turn.odef 803141c6bb41c8f9772edb1da70a03f0 +nhelens.cfg 6227827ca37b762c3d69527cb4ff4b25 +reddot.png d03679dc67f3973a551c6d78fd6e21db +checkunchecked.png faf3e9a0879b972dae9b500d9a38e002 +myhangar2.material d76bf84f7f8c12b84c01c9ef78c28f18 +map.overlay cf16c8055395c89b997efff7354007d1 +nodeselected.png e77269e4240ad7d9307fbd1a88b74fe8 +hydrostart.wav cd1b555cb34fe7e369b5fbea39dfbabe +AE86-mini.png f5e6fd591f280a4b5867bf8d6e7991f4 +dashboard-small.mesh f2cfc9c9638707ab373e6a4996f38b82 +smit.png 36352e1d5b3b85b95b51edccf3f22115 +C1beam.jpg 1e7af600253c896a274497522a855c27 +wheelband2.jpg 31d01f10dc08441a3815024d2d9b7f69 +caliber_emissive.png 07f2170b48d6775cfe9abe52a8d9bc0f +road-crossing.mesh 53ceefbb630c238686016d528787998f +truckshop.png 6ff497a737e61a7ed45d769842711461 +nedlloyd.odef 1f655198e54051984193c2147376d6ff +sign-pos-castle.odef ae5f3a99a5e6619b281c6eb3b110cfd4 +roadbridge.mesh 94ae53811b6b8ee9b46b84c4feaa81c9 +daf-mini.png 88c60fa5319822ab07890b5d5ed5e590 +road.material b0d8764a771b43684f3804b5cd3bed99 +roadborderleft.odef 5254ae4a9ab75aab7ba0e562bd97dc31 +aspen-12h.jpg d6bc79c11175dd47bff7c606999adc45 +dodgewheelface.png 1cf5d68d4551ff05977959cb0d705997 +liebherr-mini.png 3faccacfcc8354e8d766c8dc0e44b63b +Bloom.material 97c4c54fd77e547f661b804137400116 +bus2.png 7d3a94f4a9ec521c7b3c8e46186d78f4 +acontainer.load 2228b9c91dad7cf5e9ce391a6f7aaf97 +flatdaf.png 916d8f77c8080c510d821ad942973029 +t813.material 8fd53a99cde9c98f5db92ae6c71ae416 +roadborderboth.odef 12475f426a84965271dd79e5d5803c26 +semiflat.png f555dd10c2599826f4e681e42dd8b566 +Chrome.jpg 204ccbd8347395df2ff09a1e5844d493 +an12fairing-left.mesh 0c05b626d86af1ce01b67fd94ef28e1d +NACA64.3.618.afl 0b8e427e201d2e4edb7a1db31abf2d11 +myobs.material 9c717a616b3c826c0f862b076f658992 +spshi.wav 05b22fce95d238eb1bdefcd77a05639b +runway.png d7410987816a0fba8d42e1a314bf4939 +dirt.png 68b87966a6e3524fbf27a99b4c1d36c0 +sign-dir-elk-left.mesh 44b88c2c965e372bb93872ea9db062db +island-17h.jpg 2e67fd713b2fd5d73211d8b9525eaa4b +semi-mini.png 3ecdfcc56d3fce80fa1ccff23d2dcf7b +roadquay.odef 7150be3a217ea68e4eb8b98638a7f647 +smit-mini.png 973422bd3ff586a8cfb0ac2b50e82be9 +dolly.load e069410a8ceadcb741a94b9f0e655910 +unknown.png b0ddbd39adfeb6546db4b2d5ffc4b10d +fl6-volvo.material e0620e401dfe8dba705e87c7d2169c44 +flatdafrwheelface.png ebd86967619974aef77480900be7dc49 +daf_emissive.png 89d0a498135c423469f4e2bcc34f7469 +pthreadVC2.dll 5eeba1afeb9a050acb0ef64a4ec6c736 +Scanialoader.truck e0eda133b60f03e07051246d86d00ce9 +vvi.png d1a1f28e52e5bfad81735c51e7f569e3 +road-runway-band.odef ae9d730b857e5cbbedb5c3380c88db74 +sign-nhelens.png ca608c235909e02fe5ab8eb3d2b72a20 +road-block1.odef cab7de4f8edfe87c509798e76a513f6d +wrecker_emissive.png 70b8731abf7d4e1514e7c6e42813e44e +idle.wav 5a3e154c3ed121ecdcc74b564f38de4e +smallhouse2.material e01e37ec70de554c193c30c551692b5e +sign-warning.png 79525880cb5594ba27bd0d0d6927ae30 +door.wav 57760ccec8d748659bbcf208d479ac02 +sign-bump.mesh 71ebd57c4d1fed68f94e2dce72e85b18 +engfire-off.png ec596b7d08fd5cb5a4194322d77f61c0 +multibenne.png 15a6ddeca482781bf89cd91736858964 +hangardoor.material 38330c027c01a886782642d4493b3022 +airtorque.png 388c1c587822ca205c56845ff7fc4c64 +clack.wav 1bca24f6896efb327a3cd6152049faf8 +island.terrn 763efc524f5528088fca03dec9c9c42e +wahoo.material ac05c7eca3061439be97a5fb085e4e4b +Sunburn.cg bbf39aca25740fc3ddfcbf6e82cca318 +sign-dir-fish.odef 4834b1ef73855925c77136c5e2341a4e +turbotwin.material 81dfb3df76640b112d6ade67f1dea6e4 +smoke.png 5dcac3b6d02461975ecc3bdac192eabc +agoral.truck c3b29a7f2ce29dc1b2db472f2aee80e3 +cg.dll a9e7f5bfd826fe624b753749e70c0fdd +lopress-off.png 1382a874af08366bcc138add1aaa9c4b +dashboard.overlay 17a79aa26ac58ffe21d6d88fe8159c29 +derooywheelband.png 787aa1bbe2dbbfaff3f10ab9fb5becb9 +crate.material 210b0e3b36cbd44c130580a79aa47591 +sign-leftturn.mesh 12f2c490edb942751e46cd4a573de981 +derooyhelp.png 1eb9f482a95489e70a03fee2a2f80976 +chapel.odef 91f1b59b88d385bbf39bbd6705b07890 +Example_FresnelPS.asm c885dc74b9a540793c844030bfed0ba0 +multibennehelp.png 597ce0337129da445d61f9735b899661 +road-crossing.odef b472cea66c75d9e275bcb9643b170fc4 +editor.overlay c54e40f2b24a6bc5f8b572e2763665ce +dust.particle ad20a24146b71b449f597a38ffd832b0 +DevIL.dll e9994021d989ac9ac650f16d5012ba6f +dashblend.png 19f97cc9d8150a0dfbaab85a05d6c505 +ae86wheelface.png e3bdf44214bc686148a5e09864d5beae +smit.material f9e5d45060b1d3b4efbe1bd87709b1f6 +smallhouse2.odef 14965f1ccf5f3cb2cc0f820b359215b0 +chp-checkpoint.odef fe8a7370a3dc33e79cb29d57a235365c +tacho.png 89be4c0f1650785497fea7aa4cd1aeb2 +sign-bump.png 0a6a821b15aae14b6ca5ed69cad583e6 +signs.material 59e6520fce40a35c8c2d7b42cd392698 +chp-start.mesh f61972de1abade652cc3da8dcf8010bb +ILU.dll 7896cc89dbe38c8e4455deb839cc339d +README.txt 2678d34d1ac3c91773bb4b0046d8b874 +renault.truck d7f487282358aee8c3db5e75ac61f76c +sign-descent.odef 52c4d69acf7c29c80ed8eb04d1741605 +smallhouse2.jpg 761a955a88e64871a3370313edc14137 +flare.png 6cfd43aef9caceddd4b75290b87fbeea +aspen-14h.jpg bbc9b6ab5ff678552532d72502883d6e +ampliroll-mini.png cc7de65c67c52e74f1324fb23193aefb +ILUT.dll 086f8940007b2c0a9f26a09f788b849b +engstart-off.png 782314c45d30abe2bf0e75c8c07a91a5 +aspen.terrn 7d227b5d2c901960e1d0d3c7f914c2a3 +sign-dir-fish.mesh 2fa05ad3582775f974065dad950b9358 +Blur1_vs11.hlsl a9845551253e43ec1e352c6731cac508 +road-runway-end.mesh 65c51f3ff9331897a11015b63191f3d1 +dodgepolice-mini.png b33f77598ceabbddae9923c76abd1788 +kwhale.mesh 42167a1bdb210667561a4b5ea8005831 +sign-dir-cargo.mesh e4c9ec89ccf4f36461408721b46b9069 +myhangar2.odef 991817d5c95403c419f7594ecfe8972b +tracks.material a176bd6597d4a43735208e6b1aedab4b +road-slab.mesh b4b011e9db11a569531eb2349a7b72b0 +break.wav 844f96353c1ad5a8f6e328957b2e603a +hangardoor.odef b88f7f10ddbc24196cb4d5ce549145a5 +smit.truck 26702a917d93c6f11a2041984ede37f9 +semiflat.material d229bec2cdf45375e764b604120f3bbe +an-12-mini.png 0c8be87725845a925a4f101993a29b02 +island-16h.jpg cbaf7e9930bf4053f731df13930b4901 +nhelens-17h.jpg fabef8d0498764d808a67a793f0f1204 +dashboard-rh.mesh d11d678a2c897a2a6fac70738a98bae7 +roadborderleft.mesh 525d1af1ba0f86a425ad3db0d46879f8 +NACA0009.afl d62add87683f40ece9ac3d5bf051b9f3 +rollmask.png 39cf678b6ad1339c56deb3ac547ca062 +semihelp.png 69e73d9ef3ab9a64edc394865f196baa +road-block5.mesh 8c103eb01ccb27f0c928e57df8d3de87 +boatspeed.png 1b08bb44baffda65fffdd74c7931c8bc +dodge-police-emissive.png d6be99b54971c19e42841edac93fcbe5 +start.wav c8cca528d12714c3944e39fb12ffb834 +smallhouse2.mesh be9344233c7acefea739c198891c411a +3d_dashboard.overlay 3ea88a22461b5e60676939fea9ee69da +airneedles.overlay 4389bcf4c97722bb19f21191ce568d0d +smoke.particle 09b0892939c8da5d240cab10e1dcfdd4 +road-street.mesh 0dedc24b1896dcb3d5c5ee85f802a55b +flatdaf_emissive.png 378ea5b613f92bd690f232060044819c +an12wheelface.png 8860202f365a502b49ed6b6e95520a6f +common.material 06bbf8f6dbb62b09e61e8f216253bd3b +config.bmp 8319ff715dd1a0f4755c91be66334998 +screetch.wav 976fb416f711bddbab08be2c65475128 +RoR.cfg d41d8cd98f00b204e9800998ecf8427e +airspeed.png 0227993e856bf2de6dc467cedbe57ff1 +engine.overlay 5aebb32557b8f910fbeb313611710d9b +challywheelband.png e7391e734ddd6a0ec23fbcc30dc69b4a +mouse.overlay 53a895e1ce0768c08a2e7afc4534dec0 +renault.material 8568662a772a296c948a518e04864802 +secured-off.png 1b9cdc0a46b20335fc1d3025c9f57d7a +largediesel.wav dd92621e051c50ac2be44d8fff01b08e +Blur0_vs11.hlsl cdb697a1422ee54f531ef3efb982e3a8 +tunapicker.material 18fb22877881505619ecd1a3ae9a0ac4 +adi.png 09a43b908c1d249e099d7570f8740ad3 +mouse.png 44f61bc77b2a52b6d588bdcf3a27c45c +stand2.odef c3d7e6a1d1a153612159214601dba033 +t813-mini.png 02d1a7b03f496dee690b48f6d2a4a611 +dashboard.mesh 53c1127518299d9b16b009471bdb8b7e +turbotwin-mini.png 91d52abed6a01504575a3af030fe0d14 +t813.png d9266a870afbbed14c6d10c0f3a2139f +whiteneedle.png 76858effc8055ace709c31b3a20e9eee +nhelens.terrn af114f156282224f16078de724d97426 +robot.material 176ad62349af2313e1c2989c886de575 +road-turn.mesh ab7c0e3f2ffc4d22f8915e32cae8af59 +locked-on.png 112afa5cbab2053b6716719d5bca00bb +caliber.material 845ce628410a479cb046f723c81bf682 +r2skin.jpg 88707fa8a235ace6eb6ad159e3425c8b +nhelens-13h.jpg d0375d3a5be759ea5f480054f0387499 +checkchecked.png 1653da6dbb4690810166e4182845c67c +nhelens.raw 61b237a44c59ab43dcafafd8f88db2cc +lightbar.png 1ccff8609d66df833acb6bf67ddc2506 +pbrake-off.png adbedec08c4e02ebbce1a1b35e755944 +semiflat.load f8884bddbcfe442b6f4ef800f31e941c +speedo.png 606bb58f0c3c46431ea79d2bf5d5d131 +instructions.png 261f9c08d78b3e33be16281eae0a78f2 +road-slab5.odef e57a7286ab4d93775bace68f2b74dcb1 +port.mesh 197450c6e72322fedd32978255534389 +nhelens-12h.jpg fe256d1dd4d4296dc8692d4b096507c6 +challenger.png 7ce963f9fc301b3dac64fe07e05b25ab +smallhouse.mesh 587ebb5efac5d49774125deed796a06a +crane.load 4e4d9668f0e433e750c1dbeca93ee769 +nhelens-15h.jpg 326c5294241afd838ec8ea8a5a9e585f +sign-dir-elk-left.odef 6d395f038692ee28f7d5ad549c8bd05a +island-11h.jpg eeaae3bd7447ba83348602f52c55c6b3 +aspen-0h.jpg 1691b370d62d7d4c52c45fec78b5ee79 +virtualdashboard.png bb89f0eae939e6fc25af7fe8ec7c19d1 +Blur1_ps20.hlsl 97dc7ad484b71e45752ad059e29d851a +airdashboard.overlay 1bf4f959893d57fab8e6e9704ac256c9 +sign-dir-cold-left.mesh d5e4eaa9935b4811382568facb619993 +road.mesh a19397f452c855cb80c330330b962ee8 +daffwheelface.png 16bcb82e24b59a28572d7ca1517b465c +road-taxiway.odef d857acac7d230b1029cfe958b0775edd +sign-leftturn.png 89ba5902f83bf4a88e43e67c6232575b +sign-descent.mesh a32f6a81d251e3eed9ec34dedcd7935d +flatdaffwheelface.png b09274d477b3e7efa1c77f046cf2a33f +road-block2.odef 473fa59623cfea8b5338fc8be65d04bc +fl6-volvo-mini.png ea828700c0e0f6754b039877d9dc3089 +caliber-mini.png 9b6eacb2536b308981276310e6172640 +fl6-volvo-help.png 255ffa3f358fec469ba6aadbba1a509f +wrecker.truck 3323885fcbaf7841d2f8f850f0a6860d +multibenne.load 3339a362ffcdc2a48d75bf2e6d6becb2 +sign-dir-cargo.odef 3875a1688b9514e970352c885639be9a +kwhale.odef 254bd68ab398b3343b338cc791f59909 +chp.png a670a3e356177c46cdba04c64f6f3c3e +challenger.material 7a96476ba98b17532761c330d9204536 +challywheelface.png 8e7ce19a69d73d7435fcea8ff5023f8c +airhelp.png 779936d9d1ddfbb1328b06936848a11e +police.wav 5a71b8659bd72246501b557942925874 +nhelens-8h.jpg 680608e99ce3896de659ee2d1b5c9cb5 +sign-fall.png e38afff3accaa8362a81072b43d23222 +lab.odef 153e8f310adb2b737382ecb06161b472 +an-12.truck 2151a3fc95d6be546c16fe4179e4fa51 +radiosemichecked.png 156af6c973311823ff82ac52ae60b8c9 +caliber.truck 1d283c6e74f696bf46d41a1f40aed43f +agoral-mini.png 48dec6aae18e248f6df912225f693c18 +derooyfwheelface.png 16bcb82e24b59a28572d7ca1517b465c +caliberhelp.png f1ca2a11c1929a5fda26eabb2cc8f550 +aspen-mini.png ae389a5be1539c09f061cd78da6e474b +aspen-7h.jpg 88999b4b193caef16dc39624f218115a +sign-dir-john-cast.odef c28e78558b1489ecbe7afe9b596042a2 +RustySteel.jpg 1491e68a6b2d9f7b1816fbdca6af9ae6 +alut.dll 93cda701a019be29343fd9891c30e8f3 +rockeaterSXL2.truck 77cba13c09c61581abb5662f7d6daf8e +loader.overlay f76cda7054361a5bd952bba0627ea4b4 +tatrawheelface.png 46f2b09cbe60ea6a13645da06a054248 +thrusttrack.png 4f2125626abb4173150bbfbe28c060b1 +acontainer.png 2491c98f77e85770c900464001899c94 +chp-checkpoint.mesh 10a19864b18c23bdd8915251f1202ece +island-15h.jpg 4f3fefe361e5b6f2e1e9011fde7a3ad6 +road-slab5.mesh 892e9b512d59aacd57fbc05c17e4dcc1 +Combine_fp.cg 57fd09e6e3d50b851b45604d142c0d29 +lab.png 8ffdd15bff8b3ff437d88311e8da25f0 +seat.png 1799e5d99562d7d937003d919c79ca2e +sign-pos-castle.mesh 36be4b2db235d62bcc1343a082fad4fb +radiounchecked.png 8946d0f56442f5b084cccb61693c807b +smitmast.mesh 82091f1161e9a8604ddb1e177765b3d6 +beacon.png 006e2d2c4a30235882d1a6c68c4eeed1 +lopress-on.png 3a47688d7a25b208163f3f3d11da42be +boatneedles.overlay 54f3b832174580c1d70173519663da5f +smitsmoke.mesh 0c05268442b73ae78e112b2278080083 +multibenne-mini.png b7fb7d09967ec81cdc016a0934d00f51 +redarrow.png 0e93ea813f3fcca51ee7b44ff07d9eb0 +brightblueflare.png ab83ae93e89d53aed147637335f8eb49 +island-14h.jpg b2c5eafdfd3398f1372288ef949dc10a +tunapicker.png 7b8fbc87d5321a9599533da5b3142075 +daf.png e9d0d880275cf8cb0b43fcc0e3049e99 +wrecker-mini.png 6fb5651401757ae5ed9f35b541298887 +an-12.png 8f1cd7b2ad0d715ce72d692cf657c7c4 +dirwheel.mesh 6c0639bd473b8858782196a7c1ffc168 +dafhelp.png 1eb9f482a95489e70a03fee2a2f80976 +truckshop.odef 4cd0c8e44fbb72d9bd2ba39ae3a81238 +boatdashboard.overlay acab48a0171d8bc845ea0fd249acf20e +buildicon.png f4b8036e13ce53d2006ee31d71965115 +wheelband1.jpg d8409f7f1451fccc77e4f3a704065cba +myobs.jpg e6d9f8f93fa90ab948aac50f60936719 +kwhale.png a963ae88d35181707b1db089b3a75dd3 +Bloom_ps20.hlsl 6f004c6c68c1fd4dd21de30fe12963a0 +aspen-8h.jpg d746cb12980bed9ae72f5dfd073b2c1e +blackdot.png 2cbf3481eb87f1e38734c767f816752c +secured-on.png b4b524a75b6ed0340708ef5da78a35e4 +hipower.wav 06e32e2d519a0dfce4d6970b9dc7e079 +daf.truck 404e60ab7a41762d1f20b12f61ca3cd9 +kwhale.material f8f4e95a53d713152f76e0644609c904 +truckshop.mesh 4b776d3449ef9a22d6c0d173aacc2999 +dirwheel.png d89d27c3bb023e08a52548f0ba3de87e +editor.cfg 3b96db0fb8738194b02db92d27ff90d8 +tunapicker.mesh 462b6879a537821a304323e97ddb4d68 +road-runway-band.mesh 43b5501bdd7426974f2c91c8be1fe808 +rockeaterSXL2-mini.png 805a79f1987deb1b54f83508edec7461 +smalldiesel.wav 4dbc4805fb0a4ad64fda6d5f7de67946 +RoRconfig.exe 28f55bcb6b4aeecdabc77d7a89835aad +chapel.png 266374d18ca6579d89c4f57c265b0c94 +ripple.png bc1c1f76120e8b4a64dfc147b06e1dd6 +challenger-mini.png 9a769987c9ff143007084d00b82b2ef4 +wreckerhelp.png fa9fa4b668ca2977f227eb75e3a2c94f +hornstart.wav e689b0b41fe257de0d4409bfbd7aa099 +sign-descent.png 3390dd3bd5ceb24ce2b109d9b0350628 +island-13h.jpg 232bf2ab0e20c68161ca106b3c45daa3 +sign-crossing.png 4f75b8f8e9422ce5b5ab1a00413d62e3 +blueneedle.png e9a886dbe4e7e3330f76dacccf94850f +ae86emissive.png 0235aa99dfd4bb903073141e8b9bd1cc +vccrt.msi d942350b8521e5d40bde1a8b0e887aa9 +stand2.mesh 354f09f9a48b861c8ecc10206db4f28e +bridge.load 58324fdd8ab5b3e1f144ffae1618b458 +hsi.png 2a90e56f4d43707f12aff9a9ca2fa1e1 +dodge.material 6596e0ba1f6fda514fe7046c963ba6ce +sign-leftturn.odef 2e1ddae5d20c5b010327066f59b805b7 +spinprop.png 969a1df505f12d1cfe2af7596d4f818f +island-0h.jpg af9f9c83e4348680ec1db7d44ecaa540 +smallhouse.odef ff587ccf6aae6b98e1c76543897cc588 +aspen.cfg 493796144893853f212b96f304aa667a +acontainer.material ea6b391b00009a17a1327d924bdf67ac +renaulthelp.png dd3ff65e22732f5f0895dc8e342b73d0 +engfire-on.png 1c1c4bf5d465b04bd0ab0d1c6aaed4a0 +airintake.mesh 26f215467eefc4f8eafe3126be8c81b0 +sky.png 7c263b3038fff0af019dde6561734886 +liebherr.truck 14ccf4c83276eaf7ec2c92b5faf4b972 +nhelens-14h.jpg f82b786fc9c78d21a8a561fe7dc9802e +road-block5.odef f61bf9c614d773f7e1e5f3d98e18b102 +crate.png d33ab13dae480b93a45e40ca7140ded4 +wahoo.png 2a2aa71eaa2db311bbc5c9b8e8a3441a +Blur1_vs.glsl e2b930053a079a1b5a6da48b34fb7a24 +Examples.compositor 6b5e74399cf7350008f422e07358c3f5 +RoR.exe 54ccd61d6f24a6767b4427da204e9742 +renault.png 9f5e7ef0b9c17f9646307b3f50e9d28c +an-12.material c45f0630eb0d7bbc054b1022decbf3cf +turbotwintrans.png 9e5aafdc009473f5c67ca73644aab9ce +OgreMain.dll 58c0c3ccaa7e6f94eb8d43d63e9003c0 +sign-dir-stud-cast.odef 02be9edb0135a3954a0930a75950bf3c +wrecker.png f54fa1a54d5c01ed58ff5e174ade0ef4 +road-slab2.odef 67fccf56852e6095d43e5da5047dfaea +ampliroll.truck 608ee3b6170af9bbf40b85048f60d91e +EarthClearSky.png c94f5a37ffecbecbd25dd75e0e502604 +island-10h.jpg b1b3b4b9f2313a2bc4df8c7c60b2b4d6 +nhelens-mini.png 15d92bc6789be314af550e274919ec58 +mirrorlayer.png e9f680dd23aada3a1300d870ca292648 +pshi.wav 98b62d383d9686ae7f2b52b0ab648348 +redbeacon.png 4ff98f24fb8d9bc4964a65bea0274847 +plugins.cfg 5f0f8668d96fb85eb52a82e94b86273c +sign-crossing.mesh 208172ce27efbac951c0cb0e9e805906 +editor_dot.png 4576b8366285b4031b3de103a3b4ed4f +road-runway-end.odef 429f125218f89c4296a691c2f381cb61 +thrusthandle.png c3fd75252d859e7885fa6baf695d2015 +hydro.wav 8c107b733c4beb68e4f1c7bc76ee35a7 +repair.wav 6a10719471c3be693f4ae733aa8827a8 +rightmirror.mesh f1ec67e2aa7e8fbda94eb87f165e4856 +island-mini.png 1876bae0d1dc14af09052dcde1a895c0 +Blur0_vs.glsl 4879ef7e5bbafe04baf932d111c6875d +engstart-on.png 85082d7d2c583de041adebb0a70c373d +flatdafhelp.png d438d3144521552d832ceb302c472b14 +chp-start.odef 640bc084fba84f7607e11f40f1a3b6e5 +truck_editor.overlay b7f075317a4dd87c26ca898cc2bc2e9c +island.jpg 1f0461262196bdd92980f4900ba90a98 +port.odef 9eefcd94b6fed768510c521699edc52b +ign-on.png 84f05868e711aaff96d5bf9b833e39d4 +sign-crossing.odef 81c1744045fb5055e6962798520470c5 +pale.mesh 585c4186869b3cd5afe96a11844e9fce +pinksquare.png d1a684085360a947af24a619a2f286fe +brightredflare.png 3d642eed8572431d87d994749f6131d3 +greenflare.png 5c56c2a804c2bdac1c5dc1df6a5b6ef5 +nhelens-11h.jpg c864909e50c21c430b40e7d7060214cd +roadbridge.odef 9330e1b61259f269ec166f457556a7d9 +3d_dashblend.overlay 977f23ea512fa41a218f873165cf3709 +aspen-15h.jpg 156e4eb5b97970982b2371deeab43135 +fl6-volvo_emissive.png 418eeeac3c6cff801d7a88d3d3f66242 +truck_editor.material 9d7fef973236a29f7d7c2dac555a9f90 +sign-rocks.png 5823d6d6fbe0c9ae1995d081f435d7db +semi.load 77fc0cb510262acd5265dfe7f5585cc6 +locked-off.png 9307006ada0ca9f285808a6fef67c0d3 +anglo.png 5479fa805d6a779c95fe14465d4d6871 +robot-Armature.skeleton 80a8b0efd3a90c5afb7ef529f1a630be +EarthClearSkyFog.psd bf3d3856f4f7ee96fd526038b3cabcf7 +roadborderboth.mesh 247c45756d161705b63ab1201b50b76c +starterstart.wav 48ffc384d380872d14d2738e71bd62d3 +ign-off.png 109a294b9d9654f1e5546dbb9fbe2556 +lab.material f74e0e0014048d62695a38fff3157466 +dodgewheelband.png 6e084f51a802e5e2341922a5c81a569d +road.odef bc79131ec82a3e98f554fad51cdc52a6 +bus2_emissive.png b82f7f8008dd2b76078e1e45470a59cd +Plugin_OctreeSceneManager.dll a822ee904e3bec33862365e94bfbb29d +needlesmask.overlay 77895dc4cc7feaad9e2d22d494f69e18 +lopower.wav 9bb1caeb599a4efd4b34ebdd8672a9fa +sign-rightturn.odef 24370aad4f06442f9b4f85b26c18c324 +craa.wav f2c1318512b3c8a862807b11236e977b +an12wheelband.png 473c0f5cfa335dea758542552d371698 +an12turret.mesh aab0a39bdc89d0edfce414ddc1b45574 +Caelum.dll 5aee43a659ca1637733b70f3ffde89ee +sign-dir-cold-cast.odef 5db767e21fd14d1b6275dc626ca30825 +myobs.mesh de31f2e47817f2a2f9ae2be4fef956ac +road.png 25e93204cd931896ba5cb3897fc3f3df +liebherr.material 680dad0bfceeef6e80f4d405f496699c +lightbar.mesh d359381f8c3d7ab96580338988aeb745 +road-tee.mesh 071972f2344e2b38bf9fec4e4243978b +ae86.png ad2669aef97504a9ed20e38e97b1e685 +sign-dir-cold-left.odef 22cf54f2ccc1cd114b4339b57efeed4a +aspen-9h.jpg d8d1ce55760a278f9fc3e608ef7b4206 +t813_emissive.png 74e4cb8f1ee0bb47bcb8954df415b21f Modified: trunk/lib/ror/depchecker.py =================================================================== --- trunk/lib/ror/depchecker.py 2007-07-08 04:20:11 UTC (rev 92) +++ trunk/lib/ror/depchecker.py 2007-07-08 04:31:12 UTC (rev 93) @@ -14,14 +14,30 @@ self.filedeps = {} self.dir = path self.dependfilename = dependfilename - self.getfiles() + + + if mode == "md5sum": + self.getfiles(True) + self.savemd5() + sys.exit(0) + else: + self.getfiles() + + self.createDeps() self.generateCrossDep() if dependfilename != "": self.generateSingleDep() - #self.tryGraph() - + #self.tryGraph() + def savemd5(self): + lines = [] + for fn in self.files.keys(): + lines.append(os.path.basename(fn)+" "+self.files[fn]['md5']+"\n") + f=open("md5sums.txt", 'w') + f.writelines(lines) + f.close() + def getSingleDepRecursive(self, filename, depth = 0): file = self.filedeps[filename] req = [[depth, filename]] @@ -63,7 +79,7 @@ for t in tree: t.append(self.md5Sum(t[2])) for t in tree: - print "%-50s %-30s" % ("+"*t[0]+t[2], t[3]) + print "%-60s %-30s" % ("+"*t[0]+t[2], t[3]) #for f in self.filedeps.keys(): # print str(self.filedeps[f][REQUIRES]) # print str(self.filedeps[f][REQUIREDBY]) @@ -202,12 +218,14 @@ if os.path.basename(f) == filename: return f - def getfiles(self): + def getfiles(self, md5 = False): fl = {} for root, dirs, files in os.walk(self.dir): for f in files: fn = os.path.join(root, f) fl[fn] = {} + if md5: + fl[fn]['md5'] = self.md5Sum(fn) for fk in fl.keys(): print "%10s %s" % ("", fk) print "found %d files!" % (len(fl.keys())) @@ -255,13 +273,14 @@ print " 'missing' displays only unfulfilled dependencies" print " 'unused' displays resources that are not in use" print " 'dtree <resourcename>' displays the dependency tree of the given resource name" + print " 'md5sum' creates the md5sums of all files" sys.exit(0) def main(): if not os.path.isdir(sys.argv[1]): print "%s is not a valid directory!" % sys.argv[1] usage() - if (len(sys.argv) == 3 and sys.argv[2] in ['all', 'missing', 'unused']) or (len(sys.argv) == 4 and sys.argv[2] in ['dtree']): + if (len(sys.argv) == 3 and sys.argv[2] in ['all', 'missing', 'unused', 'md5sum']) or (len(sys.argv) == 4 and sys.argv[2] in ['dtree']): pass else: print "%s is not a valid mode, or incorrect arguments!" % sys.argv[2] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-08 04:20:14
|
Revision: 92 http://roreditor.svn.sourceforge.net/roreditor/?rev=92&view=rev Author: rorthomas Date: 2007-07-07 21:20:11 -0700 (Sat, 07 Jul 2007) Log Message: ----------- * added md5sums Modified Paths: -------------- trunk/lib/ror/depchecker.py Modified: trunk/lib/ror/depchecker.py =================================================================== --- trunk/lib/ror/depchecker.py 2007-07-08 04:00:10 UTC (rev 91) +++ trunk/lib/ror/depchecker.py 2007-07-08 04:20:11 UTC (rev 92) @@ -1,5 +1,5 @@ #Thomas Fischer 06/07/2007, th...@th... -import sys, os, os.path, copy +import sys, os, os.path, copy, md5 DEPCHECKPATH = "depcheckerplugins" sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), DEPCHECKPATH)) @@ -24,23 +24,46 @@ def getSingleDepRecursive(self, filename, depth = 0): file = self.filedeps[filename] - req = [(depth, filename)] + req = [[depth, filename]] #print file for r in file[REQUIRES][FILE]: try: for rr in self.getSingleDepRecursive(r, depth + 1): - req.append((rr[0], rr[1])) + duplicate = False + for a in req: + if rr[1] in a: + duplicate = True + if not duplicate: + req.append([rr[0], rr[1]]) except: pass return req + + def readFile(self, filename): + f=open(filename, 'rb') + content = f.read() + f.close() + return content + def md5Sum(self, filename): + try: + content = self.readFile(filename) + #print len(content) + except: + return + return md5.new(content).hexdigest() + def generateSingleDep(self): if not self.dependfilename in self.filedeps.keys(): print "file not found in the dependency tree!" sys.exit(0) - tree = self.getSingleDepRecursive(self.dependfilename) + tree = self.getSingleDepRecursive(self.dependfilename) for t in tree: - print "+"*t[0]+t[1] + t.append(self.getFullPath(t[1])) + for t in tree: + t.append(self.md5Sum(t[2])) + for t in tree: + print "%-50s %-30s" % ("+"*t[0]+t[2], t[3]) #for f in self.filedeps.keys(): # print str(self.filedeps[f][REQUIRES]) # print str(self.filedeps[f][REQUIREDBY]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-08 04:00:15
|
Revision: 91 http://roreditor.svn.sourceforge.net/roreditor/?rev=91&view=rev Author: rorthomas Date: 2007-07-07 21:00:10 -0700 (Sat, 07 Jul 2007) Log Message: ----------- * minor dependency corrections Modified Paths: -------------- trunk/lib/ror/depchecker.py Modified: trunk/lib/ror/depchecker.py =================================================================== --- trunk/lib/ror/depchecker.py 2007-07-08 03:10:37 UTC (rev 90) +++ trunk/lib/ror/depchecker.py 2007-07-08 04:00:10 UTC (rev 91) @@ -5,6 +5,7 @@ sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), DEPCHECKPATH)) from deptools import * +REMOVE_UNUSED_MATERIALS = True @@ -16,20 +17,35 @@ self.getfiles() self.createDeps() self.generateCrossDep() - + if dependfilename != "": + self.generateSingleDep() #self.tryGraph() - def getSingleDepRecursive(self, file, depth = 0): - req = [file] - for filenameA in self.filedeps.keys(): - fileA = self.filedeps[filenameA] - #for r in + def getSingleDepRecursive(self, filename, depth = 0): + file = self.filedeps[filename] + req = [(depth, filename)] + #print file + for r in file[REQUIRES][FILE]: + try: + for rr in self.getSingleDepRecursive(r, depth + 1): + req.append((rr[0], rr[1])) + except: + pass + return req - def generateSingleGraph(self): + def generateSingleDep(self): if not self.dependfilename in self.filedeps.keys(): print "file not found in the dependency tree!" sys.exit(0) + tree = self.getSingleDepRecursive(self.dependfilename) + for t in tree: + print "+"*t[0]+t[1] + #for f in self.filedeps.keys(): + # print str(self.filedeps[f][REQUIRES]) + # print str(self.filedeps[f][REQUIREDBY]) + # print "---------------------------------" + def tryGraph(self): try: @@ -157,15 +173,21 @@ pass return mod.getDependencies(filename) + + def getFullPath(self, filename): + for f in self.files: + if os.path.basename(f) == filename: + return f + def getfiles(self): fl = {} for root, dirs, files in os.walk(self.dir): for f in files: fn = os.path.join(root, f) fl[fn] = {} - #for fk in fl.keys(): - # print "%10s %s" % ("", fk) - #print "found %d files!" % (len(fl.keys())) + for fk in fl.keys(): + print "%10s %s" % ("", fk) + print "found %d files!" % (len(fl.keys())) self.files = fl def newRelation(self, dep): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-08 03:10:41
|
Revision: 90 http://roreditor.svn.sourceforge.net/roreditor/?rev=90&view=rev Author: rorthomas Date: 2007-07-07 20:10:37 -0700 (Sat, 07 Jul 2007) Log Message: ----------- * disabled graph and improved its settings Modified Paths: -------------- trunk/lib/ror/depchecker.py Modified: trunk/lib/ror/depchecker.py =================================================================== --- trunk/lib/ror/depchecker.py 2007-07-08 02:44:38 UTC (rev 89) +++ trunk/lib/ror/depchecker.py 2007-07-08 03:10:37 UTC (rev 90) @@ -17,7 +17,7 @@ self.createDeps() self.generateCrossDep() - self.tryGraph() + #self.tryGraph() def getSingleDepRecursive(self, file, depth = 0): @@ -53,16 +53,30 @@ graph = pydot.graph_from_edges(edges) graph.set_type('digraph') graph.simplify = True - graph.set("resolution", "160") - graph.set("overlap", "0.2") - graph.set("shape", "box") + #graph.set("resolution", "320") + graph.set("overlap", "0") + #graph.set("shape", "box") for n in graph.get_node_list(): - n.set('fontsize', 12) + n.set('fontsize', 8) n.set('style', 'filled') - n.set('fillcolor', 'lightblue2') + onlyfilename, ext = os.path.splitext(n.get_name()) + if ext == ".truck": + n.set('fillcolor', 'gold') + elif ext == ".load": + n.set('fillcolor', 'lightyellow') + elif ext == ".material": + n.set('fillcolor', 'lightseagreen') + elif ext == ".mesh": + n.set('fillcolor', 'lightsalmon') + elif ext == ".png" or ext == ".jpg" or ext == ".bmp": + n.set('fillcolor', 'lightblue') + + program = "dot" # dot or twopi + if len(self.filedeps) > 100: + program = "twopi" graph.write('dependencies.jpg', prog = program, format='jpeg') print "graph successfull written to dependencies.jpg" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-08 02:44:39
|
Revision: 89 http://roreditor.svn.sourceforge.net/roreditor/?rev=89&view=rev Author: rorthomas Date: 2007-07-07 19:44:38 -0700 (Sat, 07 Jul 2007) Log Message: ----------- * changed graph generation behavior Modified Paths: -------------- trunk/lib/ror/depchecker.py Modified: trunk/lib/ror/depchecker.py =================================================================== --- trunk/lib/ror/depchecker.py 2007-07-08 01:37:54 UTC (rev 88) +++ trunk/lib/ror/depchecker.py 2007-07-08 02:44:38 UTC (rev 89) @@ -1,6 +1,5 @@ #Thomas Fischer 06/07/2007, th...@th... import sys, os, os.path, copy -import pydot DEPCHECKPATH = "depcheckerplugins" sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), DEPCHECKPATH)) @@ -17,7 +16,9 @@ self.getfiles() self.createDeps() self.generateCrossDep() - self.drawGraph() + + self.tryGraph() + def getSingleDepRecursive(self, file, depth = 0): req = [file] @@ -29,8 +30,18 @@ if not self.dependfilename in self.filedeps.keys(): print "file not found in the dependency tree!" sys.exit(0) - + + def tryGraph(self): + try: + import pydot + print "pydot found, drawing graphs! beware this can take some time with big graphs!" + self.drawGraph() + except ImportError: + print "pydot not found, not drawing graphs" + pass + def drawGraph(self): + import pydot edges = [] for filenameA in self.filedeps.keys(): fileA = self.filedeps[filenameA] @@ -40,8 +51,22 @@ #edges = [(1,2), (1,3), (1,4), (3,4)] graph = pydot.graph_from_edges(edges) - graph.write('dependencies.png', prog='dot', format='png') + graph.set_type('digraph') + graph.simplify = True + graph.set("resolution", "160") + graph.set("overlap", "0.2") + graph.set("shape", "box") + for n in graph.get_node_list(): + n.set('fontsize', 12) + n.set('style', 'filled') + n.set('fillcolor', 'lightblue2') + + program = "dot" # dot or twopi + + graph.write('dependencies.jpg', prog = program, format='jpeg') + print "graph successfull written to dependencies.jpg" + def generateCrossDep(self): crossdep = 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-08 01:37:59
|
Revision: 88 http://roreditor.svn.sourceforge.net/roreditor/?rev=88&view=rev Author: rorthomas Date: 2007-07-07 18:37:54 -0700 (Sat, 07 Jul 2007) Log Message: ----------- * complete rewrite of the dependency checker component Modified Paths: -------------- trunk/lib/ror/depchecker.py trunk/lib/ror/depcheckerplugins/ror_bmp.py trunk/lib/ror/depcheckerplugins/ror_dds.py trunk/lib/ror/depcheckerplugins/ror_jpg.py trunk/lib/ror/depcheckerplugins/ror_material.py trunk/lib/ror/depcheckerplugins/ror_mesh.py trunk/lib/ror/depcheckerplugins/ror_png.py trunk/lib/ror/depcheckerplugins/ror_truck.py Modified: trunk/lib/ror/depchecker.py =================================================================== --- trunk/lib/ror/depchecker.py 2007-07-06 00:28:08 UTC (rev 87) +++ trunk/lib/ror/depchecker.py 2007-07-08 01:37:54 UTC (rev 88) @@ -1,19 +1,112 @@ #Thomas Fischer 06/07/2007, th...@th... -import sys, os, os.path +import sys, os, os.path, copy +import pydot -#DIR = "C:\\games\\RoR-0.31a\\data" DEPCHECKPATH = "depcheckerplugins" +sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), DEPCHECKPATH)) +from deptools import * + + + class RoRDepChecker: - def __init__(self, path, mode): - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), DEPCHECKPATH)) - self.deptree = {'materials':{},'file':{}} + def __init__(self, path, mode, dependfilename): + self.filedeps = {} self.dir = path + self.dependfilename = dependfilename self.getfiles() - self.createDepGraph() - self.viewDepGraph(mode) + self.createDeps() + self.generateCrossDep() + self.drawGraph() + + def getSingleDepRecursive(self, file, depth = 0): + req = [file] + for filenameA in self.filedeps.keys(): + fileA = self.filedeps[filenameA] + #for r in + + def generateSingleGraph(self): + if not self.dependfilename in self.filedeps.keys(): + print "file not found in the dependency tree!" + sys.exit(0) + def drawGraph(self): + edges = [] + for filenameA in self.filedeps.keys(): + fileA = self.filedeps[filenameA] + for rel in fileA[REQUIRES][FILE]: + e = (filenameA, rel) + edges.append(e) + #edges = [(1,2), (1,3), (1,4), (3,4)] + graph = pydot.graph_from_edges(edges) + graph.write('dependencies.png', prog='dot', format='png') + + + def generateCrossDep(self): + crossdep = 0 + notfound = {MATERIAL:[], FILE:[]} + newtree = copy.deepcopy(self.filedeps) + for filenameA in self.filedeps.keys(): + fileA = self.filedeps[filenameA] + for relation in [REQUIRES, OPTIONAL]: + for type in TYPES: + for reqfile in fileA[relation][type]: + found = False + for filenameB in self.filedeps.keys(): + fileB = self.filedeps[filenameB] + if filenameA == filenameB: + continue + #print filenameA, relation, type, reqfile, fileB[PROVIDES][type] + if reqfile in fileB[PROVIDES][type]: + crossdep += 1 + newtree[filenameB][REQUIREDBY][FILE].append(filenameA) + if not filenameB in fileA[REQUIRES][FILE]: + # found new + newtree[filenameA][REQUIRES][FILE].append(filenameB) + found = True + break + if not found and relation != OPTIONAL: + notfound[type].append(reqfile) + self.filedeps = newtree + #print newtree + if len(notfound[MATERIAL]) == 0 and len(notfound[FILE]) == 0: + print "### nothing missing, great!" + else: + if len(notfound[FILE]) > 0: + print "### we are missing the following files:" + print " " ,str(notfound[FILE]) + if len(notfound[MATERIAL]) > 0: + print "### we are missing the following materials:" + print " " ,str(notfound[MATERIAL]) + print "### found %d files, of which %d have dependencies." % (len(self.files), len(self.filedeps)) + for filename in self.filedeps.keys(): + file = self.filedeps[filename] + line = " %-30s " % filename + linesub = "" + sublines = [] + if len(file[REQUIRES][FILE]) > 3: + linesub = "requires: %d files" % (len(file[REQUIRES][FILE])) + elif len(file[REQUIRES][FILE]) > 0: + linesub = "requires: %s" % (str(file[REQUIRES][FILE])) + if linesub != "": + sublines.append("%-50s" % linesub) + + linesub = "" + if len(file[REQUIREDBY][FILE]) > 3: + linesub = "required by: %d files" % (len(file[REQUIREDBY][FILE])) + elif len(file[REQUIREDBY][FILE]) > 0: + linesub = "required by: %s" % (str(file[REQUIREDBY][FILE])) + if linesub != "": + sublines.append("%-50s" % linesub) + line += ", ".join(sublines) + print line + print "### %d files depends on each other" % (crossdep) + print "### advanced file dependency check finished" + + + #if len(file[PROVIDES]) == 0 + def getDependencies(self, extension, filename): try: #print "trying to use module: %s" % "ror_" + extension.lstrip(".") @@ -22,118 +115,79 @@ #print "module not found!" #print e return - pass - + pass return mod.getDependencies(filename) - def getfiles(self): fl = {} for root, dirs, files in os.walk(self.dir): for f in files: - if f in fl.keys(): - print "double file found: %s!" % (f) - continue - fl[f] = {} - fl[f]['filename'] = os.path.join(root, f) + fn = os.path.join(root, f) + fl[fn] = {} #for fk in fl.keys(): - # print "%30s: %s" % (fk, fl[fk]['filename']) - print "found %d files!" % (len(fl.keys())) + # print "%10s %s" % ("", fk) + #print "found %d files!" % (len(fl.keys())) self.files = fl - - def viewDepGraph(self, mode = "all"): - displayedfiles = 0 - str = "" - str += "-------------------------------------------------------------\n" - if mode == "all": - str += "--- Dependency tree for %s \n" % (self.dir) - elif mode == "unused": - str += "--- Unused resources for %s \n" % (self.dir) - elif mode == "missing": - str += "--- Missing requirements for %s \n" % (self.dir) - str += "-------------------------------------------------------------\n" - for fk in self.deptree.keys(): - str += "--------- Category: %-20s -------------------\n" % fk - for k in self.deptree[fk].keys(): - req = self.deptree[fk][k]['depends'] - if len(req) > 0: - reqstr = ", ".join(req) + def newRelation(self, dep): + # ensures that each field exists + tmp = {} + for rel in RELATIONS: + tmp[rel] = {} + for type in TYPES: + tmp[rel][type] = [] + for rel in dep.keys(): + for type in dep[rel].keys(): + if type == FILE: + for f in dep[rel][type]: + #print f + tmp[rel][type].append(os.path.basename(f)) else: - reqstr = "None" - found = self.deptree[fk][k]['provide'] - if len(found) > 0: - foundstr = ", ".join(found) - else: - foundstr = "None" - display = False - if mode == "all": - display = True - elif mode == "unused": - display = (len(found) > 0 and len(req) == 0) - elif mode == "missing": - display = (len(req) > 0 and len(found) == 0) - if display: - displayedfiles += 1 - if mode == "all": - str += "%40s: %16s%-10s\n%41s %16s%-10s\n" % (k, "required by: ", reqstr, "", "provided by: ", foundstr) - elif mode == "unused": - str += "%40s: %16s%-10s\n" % (k, "provided by: ", foundstr) - elif mode == "missing": - str += "%40s: %16s%-10s\n" % (k, "required by: ", reqstr) - if displayedfiles > 0: - print str - elif displayedfiles == 0: - if mode == "all": - print "No resources found at all!" - elif mode == "unused": - print "No resources unused!" - elif mode == "missing": - print "No resources missing!" - + tmp[rel][type] = dep[rel][type] + return tmp - - def createDepGraph(self): - #extlist = [] - for fk in self.files.keys(): - fn, ext = os.path.splitext(fk) - filename = self.files[fk]['filename'] - dep = self.getDependencies(ext, filename) - keywords = ['provide', 'depends'] - if not dep is None: - for kw in keywords: - if kw in dep.keys(): - for pk in dep[kw].keys(): - for p in dep[kw][pk]: - #print kw, pk, p - if not p in self.deptree[pk].keys(): - self.deptree[pk][p] = {keywords[0]:[], keywords[1]:[]} - self.deptree[pk][p][kw].append(fk) - - - #if not ext in extlist: - # extlist.append(ext) - #print extlist - + def createDeps(self): + tree = self.filedeps + print "### dependency checker log following" + for filename in self.files.keys(): + onlyfilename, extension = os.path.splitext(filename) + basefilename = os.path.basename(filename) + dependencies = self.getDependencies(extension, filename) + #print "DEP "+ basefilename +" / "+str(dependencies) + if not dependencies is None: + for relation in dependencies.keys(): + deps = dependencies[relation] + tree[basefilename] = {} + tree[basefilename][relation] = {} + for type in deps.keys(): + tree[basefilename] = self.newRelation(dependencies) + print "### file dependency check finished" def usage(): print "usage: %s <path to inspect> <all or unused or missing>" % os.path.basename(sys.argv[0]) print "for example: %s c:\\ror\\data missing" % os.path.basename(sys.argv[0]) - print " * all will display all dependencies, inclusive met ones" - print " * missing will display only unfulfilled dependencies" - print " * unused will display resources that are not in use" + print " valid modes:" + print " 'all' displays all dependencies, inclusive fulfilled ones" + print " 'missing' displays only unfulfilled dependencies" + print " 'unused' displays resources that are not in use" + print " 'dtree <resourcename>' displays the dependency tree of the given resource name" sys.exit(0) def main(): - if len(sys.argv) != 3: - usage() if not os.path.isdir(sys.argv[1]): print "%s is not a valid directory!" % sys.argv[1] usage() - if not sys.argv[2] in ['all', 'missing', 'unused']: - print "%s is not a valid mode!" % sys.argv[2] + if (len(sys.argv) == 3 and sys.argv[2] in ['all', 'missing', 'unused']) or (len(sys.argv) == 4 and sys.argv[2] in ['dtree']): + pass + else: + print "%s is not a valid mode, or incorrect arguments!" % sys.argv[2] usage() - RoRDepChecker(sys.argv[1], sys.argv[2]) + + dependfilename = "" + if len(sys.argv) == 4 and sys.argv[2] in ['dtree'] and sys.argv[3].strip() != "": + dependfilename = sys.argv[3].strip() + + RoRDepChecker(sys.argv[1], sys.argv[2], dependfilename) if __name__ == "__main__": main() Modified: trunk/lib/ror/depcheckerplugins/ror_bmp.py =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_bmp.py 2007-07-06 00:28:08 UTC (rev 87) +++ trunk/lib/ror/depcheckerplugins/ror_bmp.py 2007-07-08 01:37:54 UTC (rev 88) @@ -1,9 +1,14 @@ import os, os.path, re import subprocess +from deptools import * def getDependencies(filename): return { - "provide":{ - "file":[os.path.basename(filename)] - } + OPTIONAL:{ + }, + REQUIRES:{ + }, + PROVIDES:{ + FILE:[filename], + }, } Modified: trunk/lib/ror/depcheckerplugins/ror_dds.py =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_dds.py 2007-07-06 00:28:08 UTC (rev 87) +++ trunk/lib/ror/depcheckerplugins/ror_dds.py 2007-07-08 01:37:54 UTC (rev 88) @@ -1,9 +1,14 @@ import os, os.path, re import subprocess +from deptools import * def getDependencies(filename): return { - "provide":{ - "file":[os.path.basename(filename)] - } + OPTIONAL:{ + }, + REQUIRES:{ + }, + PROVIDES:{ + FILE:[filename], + }, } Modified: trunk/lib/ror/depcheckerplugins/ror_jpg.py =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_jpg.py 2007-07-06 00:28:08 UTC (rev 87) +++ trunk/lib/ror/depcheckerplugins/ror_jpg.py 2007-07-08 01:37:54 UTC (rev 88) @@ -1,9 +1,14 @@ import os, os.path, re import subprocess +from deptools import * def getDependencies(filename): return { - "provide":{ - "file":[os.path.basename(filename)] - } + OPTIONAL:{ + }, + REQUIRES:{ + }, + PROVIDES:{ + FILE:[filename], + }, } Modified: trunk/lib/ror/depcheckerplugins/ror_material.py =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_material.py 2007-07-06 00:28:08 UTC (rev 87) +++ trunk/lib/ror/depcheckerplugins/ror_material.py 2007-07-08 01:37:54 UTC (rev 88) @@ -1,5 +1,6 @@ import os, os.path, re import subprocess +from deptools import * RE1 = r"^\s*texture.?([a-zA-Z0-9_\-]*\.[a-zA-Z0-9]*)\s?.*" RE2 = r"\s?material\s?([a-zA-Z0-9_/\-\\]*).?" @@ -30,10 +31,13 @@ print "no material found in material file " + filename else: return { - "depends":{ - "file":dep - }, - "provide":{ - "materials":prov - } - } + OPTIONAL:{ + }, + REQUIRES:{ + FILE:dep, + }, + PROVIDES:{ + MATERIAL:prov, + FILE:[filename], + }, + } \ No newline at end of file Modified: trunk/lib/ror/depcheckerplugins/ror_mesh.py =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_mesh.py 2007-07-06 00:28:08 UTC (rev 87) +++ trunk/lib/ror/depcheckerplugins/ror_mesh.py 2007-07-08 01:37:54 UTC (rev 88) @@ -1,6 +1,8 @@ import sys, os, os.path, re import subprocess +from deptools import * + # todo remove this hardcoded stuff here! CONVERTERBIN = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..\\..\\..\\tools\\OgreCommandLineTools\\OgreXmlConverter.exe")) REs = [r".*material\s?=[\"\']([a-zA-Z0-9_/\-\\]*)[\"\'].*"] @@ -43,7 +45,13 @@ print "no material found for file " + filename else: return { - "depends":{ - "materials":dep - } + OPTIONAL:{ + }, + REQUIRES:{ + MATERIAL:dep, + }, + PROVIDES:{ + FILE:[filename], + }, } + Modified: trunk/lib/ror/depcheckerplugins/ror_png.py =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_png.py 2007-07-06 00:28:08 UTC (rev 87) +++ trunk/lib/ror/depcheckerplugins/ror_png.py 2007-07-08 01:37:54 UTC (rev 88) @@ -1,9 +1,15 @@ import os, os.path, re import subprocess +from deptools import * + def getDependencies(filename): return { - "provide":{ - "file":[os.path.basename(filename)] - } + OPTIONAL:{ + }, + REQUIRES:{ + }, + PROVIDES:{ + FILE:[filename], + }, } Modified: trunk/lib/ror/depcheckerplugins/ror_truck.py =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_truck.py 2007-07-06 00:28:08 UTC (rev 87) +++ trunk/lib/ror/depcheckerplugins/ror_truck.py 2007-07-08 01:37:54 UTC (rev 88) @@ -1,5 +1,6 @@ import os, os.path from ror.truckparser import * +from deptools import * def getDependencies(filename): p = rorparser() @@ -9,13 +10,25 @@ truckfilename = os.path.basename(filename) truckname, ext = os.path.splitext(truckfilename) matname = p.tree['globals'][0]['data'][2] + + # collect props + props = [] + if 'props' in p.tree.keys(): + for prop in p.tree['props']: + props.append(prop['data'][-1]) + #print props + #print truckname return { - "depends":{ - "materials":[matname], - #"file":[truckname+'-mini.png'] - }, - "provide":{ - "file":[truckfilename] - } + OPTIONAL:{ + MATERIAL:["tracks/"+truckname+'help'], + FILE:[truckname+'-mini.png'], + }, + REQUIRES:{ + MATERIAL:[matname], + FILE:props, + }, + PROVIDES:{ + FILE:[filename], + }, } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-06 00:28:10
|
Revision: 87 http://roreditor.svn.sourceforge.net/roreditor/?rev=87&view=rev Author: rorthomas Date: 2007-07-05 17:28:08 -0700 (Thu, 05 Jul 2007) Log Message: ----------- * renamed depchecker plugins dir * fixed truck dependency checker Modified Paths: -------------- trunk/lib/ror/depchecker.py Added Paths: ----------- trunk/lib/ror/depcheckerplugins/ trunk/lib/ror/depcheckerplugins/__init__.py trunk/lib/ror/depcheckerplugins/ror_bmp.py trunk/lib/ror/depcheckerplugins/ror_dds.py trunk/lib/ror/depcheckerplugins/ror_jpg.py trunk/lib/ror/depcheckerplugins/ror_load.py trunk/lib/ror/depcheckerplugins/ror_material.py trunk/lib/ror/depcheckerplugins/ror_mesh.py trunk/lib/ror/depcheckerplugins/ror_overlay.py trunk/lib/ror/depcheckerplugins/ror_png.py trunk/lib/ror/depcheckerplugins/ror_truck.py Removed Paths: ------------- trunk/lib/ror/depchecker/ trunk/lib/ror/depcheckerplugins/ror_bmp.py trunk/lib/ror/depcheckerplugins/ror_dds.py trunk/lib/ror/depcheckerplugins/ror_jpg.py trunk/lib/ror/depcheckerplugins/ror_load.py trunk/lib/ror/depcheckerplugins/ror_material.py trunk/lib/ror/depcheckerplugins/ror_mesh.py trunk/lib/ror/depcheckerplugins/ror_overlay.py trunk/lib/ror/depcheckerplugins/ror_png.py trunk/lib/ror/depcheckerplugins/ror_truck.py Modified: trunk/lib/ror/depchecker.py =================================================================== --- trunk/lib/ror/depchecker.py 2007-07-06 00:16:10 UTC (rev 86) +++ trunk/lib/ror/depchecker.py 2007-07-06 00:28:08 UTC (rev 87) @@ -2,7 +2,7 @@ import sys, os, os.path #DIR = "C:\\games\\RoR-0.31a\\data" -DEPCHECKPATH = "depchecker" +DEPCHECKPATH = "depcheckerplugins" class RoRDepChecker: def __init__(self, path, mode): @@ -16,8 +16,11 @@ def getDependencies(self, extension, filename): try: + #print "trying to use module: %s" % "ror_" + extension.lstrip(".") mod = __import__("ror_" + extension.lstrip(".")) except ImportError, e: + #print "module not found!" + #print e return pass Copied: trunk/lib/ror/depcheckerplugins (from rev 83, trunk/lib/ror/depchecker) Added: trunk/lib/ror/depcheckerplugins/__init__.py =================================================================== Deleted: trunk/lib/ror/depcheckerplugins/ror_bmp.py =================================================================== --- trunk/lib/ror/depchecker/ror_bmp.py 2007-07-05 23:29:38 UTC (rev 83) +++ trunk/lib/ror/depcheckerplugins/ror_bmp.py 2007-07-06 00:28:08 UTC (rev 87) @@ -1,9 +0,0 @@ -import os, os.path, re -import subprocess - -def getDependencies(filename): - return { - "provide":{ - "file":[os.path.basename(filename)] - } - } Copied: trunk/lib/ror/depcheckerplugins/ror_bmp.py (from rev 86, trunk/lib/ror/depchecker/ror_bmp.py) =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_bmp.py (rev 0) +++ trunk/lib/ror/depcheckerplugins/ror_bmp.py 2007-07-06 00:28:08 UTC (rev 87) @@ -0,0 +1,9 @@ +import os, os.path, re +import subprocess + +def getDependencies(filename): + return { + "provide":{ + "file":[os.path.basename(filename)] + } + } Deleted: trunk/lib/ror/depcheckerplugins/ror_dds.py =================================================================== --- trunk/lib/ror/depchecker/ror_dds.py 2007-07-05 23:29:38 UTC (rev 83) +++ trunk/lib/ror/depcheckerplugins/ror_dds.py 2007-07-06 00:28:08 UTC (rev 87) @@ -1,9 +0,0 @@ -import os, os.path, re -import subprocess - -def getDependencies(filename): - return { - "provide":{ - "file":[os.path.basename(filename)] - } - } Copied: trunk/lib/ror/depcheckerplugins/ror_dds.py (from rev 86, trunk/lib/ror/depchecker/ror_dds.py) =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_dds.py (rev 0) +++ trunk/lib/ror/depcheckerplugins/ror_dds.py 2007-07-06 00:28:08 UTC (rev 87) @@ -0,0 +1,9 @@ +import os, os.path, re +import subprocess + +def getDependencies(filename): + return { + "provide":{ + "file":[os.path.basename(filename)] + } + } Deleted: trunk/lib/ror/depcheckerplugins/ror_jpg.py =================================================================== --- trunk/lib/ror/depchecker/ror_jpg.py 2007-07-05 23:29:38 UTC (rev 83) +++ trunk/lib/ror/depcheckerplugins/ror_jpg.py 2007-07-06 00:28:08 UTC (rev 87) @@ -1,9 +0,0 @@ -import os, os.path, re -import subprocess - -def getDependencies(filename): - return { - "provide":{ - "file":[os.path.basename(filename)] - } - } Copied: trunk/lib/ror/depcheckerplugins/ror_jpg.py (from rev 86, trunk/lib/ror/depchecker/ror_jpg.py) =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_jpg.py (rev 0) +++ trunk/lib/ror/depcheckerplugins/ror_jpg.py 2007-07-06 00:28:08 UTC (rev 87) @@ -0,0 +1,9 @@ +import os, os.path, re +import subprocess + +def getDependencies(filename): + return { + "provide":{ + "file":[os.path.basename(filename)] + } + } Deleted: trunk/lib/ror/depcheckerplugins/ror_load.py =================================================================== --- trunk/lib/ror/depchecker/ror_load.py 2007-07-05 23:29:38 UTC (rev 83) +++ trunk/lib/ror/depcheckerplugins/ror_load.py 2007-07-06 00:28:08 UTC (rev 87) @@ -1,5 +0,0 @@ -import os, os.path -import ror_truck - -def getDependencies(filename): - return ror_truck.getDependencies(filename) Copied: trunk/lib/ror/depcheckerplugins/ror_load.py (from rev 86, trunk/lib/ror/depchecker/ror_load.py) =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_load.py (rev 0) +++ trunk/lib/ror/depcheckerplugins/ror_load.py 2007-07-06 00:28:08 UTC (rev 87) @@ -0,0 +1,5 @@ +import os, os.path +import ror_truck + +def getDependencies(filename): + return ror_truck.getDependencies(filename) Deleted: trunk/lib/ror/depcheckerplugins/ror_material.py =================================================================== --- trunk/lib/ror/depchecker/ror_material.py 2007-07-05 23:29:38 UTC (rev 83) +++ trunk/lib/ror/depcheckerplugins/ror_material.py 2007-07-06 00:28:08 UTC (rev 87) @@ -1,39 +0,0 @@ -import os, os.path, re -import subprocess - -RE1 = r"^\s*texture.?([a-zA-Z0-9_\-]*\.[a-zA-Z0-9]*)\s?.*" -RE2 = r"\s?material\s?([a-zA-Z0-9_/\-\\]*).?" - -def readFile(filename): - f=open(filename, 'r') - content = f.readlines() - f.close() - return content - -def parseRE(content, r): - vals = [] - for line in content: - m = re.match(r, line) - if not m is None and len(m.groups()) > 0: - valname = m.groups()[0] - if not valname in vals: - vals.append(valname) - return vals - -def getDependencies(filename): - content = readFile(filename) - dep = parseRE(content, RE1) - prov = parseRE(content, RE2) - if len(dep) == 0: - print "no texture found in material file " + filename - if len(prov) == 0: - print "no material found in material file " + filename - else: - return { - "depends":{ - "file":dep - }, - "provide":{ - "materials":prov - } - } Copied: trunk/lib/ror/depcheckerplugins/ror_material.py (from rev 86, trunk/lib/ror/depchecker/ror_material.py) =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_material.py (rev 0) +++ trunk/lib/ror/depcheckerplugins/ror_material.py 2007-07-06 00:28:08 UTC (rev 87) @@ -0,0 +1,39 @@ +import os, os.path, re +import subprocess + +RE1 = r"^\s*texture.?([a-zA-Z0-9_\-]*\.[a-zA-Z0-9]*)\s?.*" +RE2 = r"\s?material\s?([a-zA-Z0-9_/\-\\]*).?" + +def readFile(filename): + f=open(filename, 'r') + content = f.readlines() + f.close() + return content + +def parseRE(content, r): + vals = [] + for line in content: + m = re.match(r, line) + if not m is None and len(m.groups()) > 0: + valname = m.groups()[0] + if not valname in vals: + vals.append(valname) + return vals + +def getDependencies(filename): + content = readFile(filename) + dep = parseRE(content, RE1) + prov = parseRE(content, RE2) + if len(dep) == 0: + print "no texture found in material file " + filename + if len(prov) == 0: + print "no material found in material file " + filename + else: + return { + "depends":{ + "file":dep + }, + "provide":{ + "materials":prov + } + } Deleted: trunk/lib/ror/depcheckerplugins/ror_mesh.py =================================================================== --- trunk/lib/ror/depchecker/ror_mesh.py 2007-07-05 23:29:38 UTC (rev 83) +++ trunk/lib/ror/depcheckerplugins/ror_mesh.py 2007-07-06 00:28:08 UTC (rev 87) @@ -1,48 +0,0 @@ -import os, os.path, re -import subprocess - -CONVERTERBIN = "C:\\OgreCommandLineTools\\OgreXmlConverter.exe" -REs = [r".*material\s?=[\"\']([a-zA-Z0-9_/\-\\]*)[\"\'].*"] - -def readFile(filename): - f=open(filename, 'r') - content = f.readlines() - f.close() - return content - -def convertToXML(filename): - # try to convert to .msh.xml first! - cmd = CONVERTERBIN + " " + filename - p = subprocess.Popen(cmd, shell = False, cwd = os.path.dirname(CONVERTERBIN), stderr = subprocess.PIPE, stdout = subprocess.PIPE) - p.wait() - print "mesh converted: " + filename - -def parseRE(content): - deps = [] - for line in content: - for r in REs: - m = re.match(r, line) - if not m is None and len(m.groups()) > 0: - depname = m.groups()[0] - if not depname in deps: - deps.append(depname) - return deps - - -def getDependencies(filename): - xmlfilename = os.path.join(os.path.dirname(filename), os.path.basename(filename)+".xml") - if not os.path.isfile(xmlfilename): - convertToXML(filename) - try: - content = readFile(xmlfilename) - except Exception, e: - print e - dep = parseRE(content) - if len(dep) == 0: - print "no material found for file " + filename - else: - return { - "depends":{ - "materials":dep - } - } Copied: trunk/lib/ror/depcheckerplugins/ror_mesh.py (from rev 86, trunk/lib/ror/depchecker/ror_mesh.py) =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_mesh.py (rev 0) +++ trunk/lib/ror/depcheckerplugins/ror_mesh.py 2007-07-06 00:28:08 UTC (rev 87) @@ -0,0 +1,49 @@ +import sys, os, os.path, re +import subprocess + +# todo remove this hardcoded stuff here! +CONVERTERBIN = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..\\..\\..\\tools\\OgreCommandLineTools\\OgreXmlConverter.exe")) +REs = [r".*material\s?=[\"\']([a-zA-Z0-9_/\-\\]*)[\"\'].*"] + +def readFile(filename): + f=open(filename, 'r') + content = f.readlines() + f.close() + return content + +def convertToXML(filename): + # try to convert to .msh.xml first! + cmd = CONVERTERBIN + " " + filename + p = subprocess.Popen(cmd, shell = False, cwd = os.path.dirname(CONVERTERBIN), stderr = subprocess.PIPE, stdout = subprocess.PIPE) + p.wait() + print "mesh converted: " + filename + +def parseRE(content): + deps = [] + for line in content: + for r in REs: + m = re.match(r, line) + if not m is None and len(m.groups()) > 0: + depname = m.groups()[0] + if not depname in deps: + deps.append(depname) + return deps + + +def getDependencies(filename): + xmlfilename = os.path.join(os.path.dirname(filename), os.path.basename(filename)+".xml") + if not os.path.isfile(xmlfilename): + convertToXML(filename) + try: + content = readFile(xmlfilename) + except Exception, e: + print e + dep = parseRE(content) + if len(dep) == 0: + print "no material found for file " + filename + else: + return { + "depends":{ + "materials":dep + } + } Deleted: trunk/lib/ror/depcheckerplugins/ror_overlay.py =================================================================== --- trunk/lib/ror/depchecker/ror_overlay.py 2007-07-05 23:29:38 UTC (rev 83) +++ trunk/lib/ror/depcheckerplugins/ror_overlay.py 2007-07-06 00:28:08 UTC (rev 87) @@ -1,5 +0,0 @@ -import os, os.path, re -import subprocess - -def getDependencies(filename): - pass Copied: trunk/lib/ror/depcheckerplugins/ror_overlay.py (from rev 86, trunk/lib/ror/depchecker/ror_overlay.py) =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_overlay.py (rev 0) +++ trunk/lib/ror/depcheckerplugins/ror_overlay.py 2007-07-06 00:28:08 UTC (rev 87) @@ -0,0 +1,5 @@ +import os, os.path, re +import subprocess + +def getDependencies(filename): + pass Deleted: trunk/lib/ror/depcheckerplugins/ror_png.py =================================================================== --- trunk/lib/ror/depchecker/ror_png.py 2007-07-05 23:29:38 UTC (rev 83) +++ trunk/lib/ror/depcheckerplugins/ror_png.py 2007-07-06 00:28:08 UTC (rev 87) @@ -1,9 +0,0 @@ -import os, os.path, re -import subprocess - -def getDependencies(filename): - return { - "provide":{ - "file":[os.path.basename(filename)] - } - } Copied: trunk/lib/ror/depcheckerplugins/ror_png.py (from rev 86, trunk/lib/ror/depchecker/ror_png.py) =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_png.py (rev 0) +++ trunk/lib/ror/depcheckerplugins/ror_png.py 2007-07-06 00:28:08 UTC (rev 87) @@ -0,0 +1,9 @@ +import os, os.path, re +import subprocess + +def getDependencies(filename): + return { + "provide":{ + "file":[os.path.basename(filename)] + } + } Deleted: trunk/lib/ror/depcheckerplugins/ror_truck.py =================================================================== --- trunk/lib/ror/depchecker/ror_truck.py 2007-07-05 23:29:38 UTC (rev 83) +++ trunk/lib/ror/depcheckerplugins/ror_truck.py 2007-07-06 00:28:08 UTC (rev 87) @@ -1,21 +0,0 @@ -import os, os.path -from truckparser import * - -def getDependencies(filename): - p = rorparser() - p.parse(filename) - if not 'globals' in p.tree.keys(): - print "truck parsing error on file " + filename - truckfilename = os.path.basename(filename) - truckname, ext = os.path.splitext(truckfilename) - matname = p.tree['globals'][0]['data'][2] - print truckname - return { - "depends":{ - "materials":[matname], - #"file":[truckname+'-mini.png'] - }, - "provide":{ - "file":[truckfilename] - } - } Copied: trunk/lib/ror/depcheckerplugins/ror_truck.py (from rev 86, trunk/lib/ror/depchecker/ror_truck.py) =================================================================== --- trunk/lib/ror/depcheckerplugins/ror_truck.py (rev 0) +++ trunk/lib/ror/depcheckerplugins/ror_truck.py 2007-07-06 00:28:08 UTC (rev 87) @@ -0,0 +1,21 @@ +import os, os.path +from ror.truckparser import * + +def getDependencies(filename): + p = rorparser() + p.parse(filename, verbose=False) + if not 'globals' in p.tree.keys(): + print "truck parsing error on file " + filename + truckfilename = os.path.basename(filename) + truckname, ext = os.path.splitext(truckfilename) + matname = p.tree['globals'][0]['data'][2] + #print truckname + return { + "depends":{ + "materials":[matname], + #"file":[truckname+'-mini.png'] + }, + "provide":{ + "file":[truckfilename] + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-06 00:16:23
|
Revision: 86 http://roreditor.svn.sourceforge.net/roreditor/?rev=86&view=rev Author: rorthomas Date: 2007-07-05 17:16:10 -0700 (Thu, 05 Jul 2007) Log Message: ----------- * added bat shortcuts for depchecker * added ogrecmdlinetools to tools\ Modified Paths: -------------- trunk/lib/ror/depchecker/ror_mesh.py Added Paths: ----------- trunk/depchecker.bat trunk/depchecker.py trunk/tools/OgreCommandLineTools/ trunk/tools/OgreCommandLineTools/OgreMain.dll trunk/tools/OgreCommandLineTools/OgreMaterialUpgrade.exe trunk/tools/OgreCommandLineTools/OgreMeshUpgrade.exe trunk/tools/OgreCommandLineTools/OgreXmlConverter.exe trunk/tools/OgreCommandLineTools/Readme.txt trunk/tools/OgreCommandLineTools/devil.dll trunk/tools/OgreCommandLineTools/ilu.dll trunk/tools/OgreCommandLineTools/ilut.dll trunk/tools/OgreCommandLineTools/zlib1.dll Added: trunk/depchecker.bat =================================================================== --- trunk/depchecker.bat (rev 0) +++ trunk/depchecker.bat 2007-07-06 00:16:10 UTC (rev 86) @@ -0,0 +1 @@ +%systemdrive%\python25\python.exe depchecker.py %1 %2 %3 %4 %5 %6 %7 %8 %9 Added: trunk/depchecker.py =================================================================== --- trunk/depchecker.py (rev 0) +++ trunk/depchecker.py 2007-07-06 00:16:10 UTC (rev 86) @@ -0,0 +1,28 @@ +#Thomas Fischer 31/05/2007, th...@th... +import sys, os, os.path + +def main(): + """ + main method + """ + + sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib")) + import ror.settingsManager + path = ror.settingsManager.getSettingsManager().getSetting("RigsOfRods", "BasePath") + if not os.path.isfile(os.path.join(path,"RoR.exe")): + import ror.starter + ror.starter.startApp() + + # Import Psyco if available + try: + import psyco + psyco.full() + except ImportError: + pass + + import ror.depchecker + ror.depchecker.main() + + +if __name__=="__main__": + main() \ No newline at end of file Modified: trunk/lib/ror/depchecker/ror_mesh.py =================================================================== --- trunk/lib/ror/depchecker/ror_mesh.py 2007-07-05 23:52:07 UTC (rev 85) +++ trunk/lib/ror/depchecker/ror_mesh.py 2007-07-06 00:16:10 UTC (rev 86) @@ -1,7 +1,8 @@ -import os, os.path, re +import sys, os, os.path, re import subprocess -CONVERTERBIN = "C:\\OgreCommandLineTools\\OgreXmlConverter.exe" +# todo remove this hardcoded stuff here! +CONVERTERBIN = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..\\..\\..\\tools\\OgreCommandLineTools\\OgreXmlConverter.exe")) REs = [r".*material\s?=[\"\']([a-zA-Z0-9_/\-\\]*)[\"\'].*"] def readFile(filename): Added: trunk/tools/OgreCommandLineTools/OgreMain.dll =================================================================== (Binary files differ) Property changes on: trunk/tools/OgreCommandLineTools/OgreMain.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/tools/OgreCommandLineTools/OgreMaterialUpgrade.exe =================================================================== (Binary files differ) Property changes on: trunk/tools/OgreCommandLineTools/OgreMaterialUpgrade.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/tools/OgreCommandLineTools/OgreMeshUpgrade.exe =================================================================== (Binary files differ) Property changes on: trunk/tools/OgreCommandLineTools/OgreMeshUpgrade.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/tools/OgreCommandLineTools/OgreXmlConverter.exe =================================================================== (Binary files differ) Property changes on: trunk/tools/OgreCommandLineTools/OgreXmlConverter.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/tools/OgreCommandLineTools/Readme.txt =================================================================== --- trunk/tools/OgreCommandLineTools/Readme.txt (rev 0) +++ trunk/tools/OgreCommandLineTools/Readme.txt 2007-07-06 00:16:10 UTC (rev 86) @@ -0,0 +1,108 @@ +OGRE COMMAND-LINE UTILITIES +=========================== + +This archive contains a few prebuilt command-line tools for manipulating your +media. For further info, visit http://www.ogre3d.org + +OgreXMLConverter +---------------- +Converts between the binary and XML formats for .mesh and .skeleton. Will also +allow you to generate LOD information if you are converting to the binary +format. This tool is necessary to convert from the XML to OGRE's native runtime +format if your exporter produces XML. You can find the XML Schema for the .mesh +and .skeleton formats in the Ogre source under Tools/XMLConverter/docs. + +Usage: OgreXMLConverter [options] sourcefile [destfile] + +Available options: +-i = interactive mode - prompt for options +(The next 4 options are only applicable when converting XML to Mesh) +-l lodlevels = number of LOD levels +-d loddist = distance increment to reduce LOD +-p lodpercent = Percentage triangle reduction amount per LOD +-f lodnumtris = Fixed vertex reduction per LOD +-e = DON'T generate edge lists (for stencil shadows) +-r = DON'T reorganise vertex buffers to OGRE recommended format. +-t = Generate tangents (for normal mapping) +-o = DON'T optimise out redundant tracks & keyframes +-d3d = Prefer D3D packed colour formats (default on Windows) +-gl = Prefer GL packed colour formats (default on non-Windows) +-E endian = Set endian mode 'big' 'little' or 'native' (default) +-q = Quiet mode, less output +-log filename = name of the log file (default: 'OgreXMLConverter.log') +sourcefile = name of file to convert +destfile = optional name of file to write to. If you don't + specify this OGRE works it out through the extension + and the XML contents if the source is XML. For example + test.mesh becomes test.xml, test.xml becomes test.mesh + if the XML document root is <mesh> etc. + +Because the default behaviour is to convert binary to XML and vice versa, you +can simply drag files onto this converter and it will convert between the 2 +formats, although you will not be able to use it to generate LOD levels this +way. + +OgreMeshUpgrade +--------------- + +This tool upgrades a .mesh file from any previous version of OGRE to the latest +version. You will be advised in Ogre.log if your meshes are of an old version; +OGRE can still load old versions but performance may not be as good as it would +be with the latest version. You are advised to upgrade your meshes whenever you +update to another major version of OGRE. + +Usage: OgreMeshUpgrader [options] sourcefile [destfile] +-i = Interactive mode, prompt for options +-l lodlevels = number of LOD levels +-d loddist = distance increment to reduce LOD +-p lodpercent = Percentage triangle reduction amount per LOD +-f lodnumtris = Fixed vertex reduction per LOD +-e = DON'T generate edge lists (for stencil shadows) +-t = Generate tangents (for normal mapping) +-r = DON'T reorganise buffers to recommended format +-d3d = Convert to D3D colour formats +-gl = Convert to GL colour formats +-srcd3d = Interpret ambiguous colours as D3D style +-srcgl = Interpret ambiguous colours as GL style +-E endian = Set endian mode 'big' 'little' or 'native' (default) +sourcefile = name of file to convert +destfile = optional name of file to write to. If you don't + specify this OGRE overwrites the existing file. + +Again you can drag files onto this tool, so long as you don't mind it +overwriting the file in place. If you'd prefer to keep a backup, make a copy or +use the command line to upgrade to a different file. + +Reorganising vertex buffers: this tool now allows you to restructure the vertex +buffers in your mesh. If you are upgrading from a version prior to 0.15.0, then +you should answer 'y' when asked if you want to reorganise the buffers, since +0.15.0 and later allows more efficient structures in the binary mesh. You will +then be shown the buffer structures for each of the geometry sections; you can +either reorganise the buffers yourself, or use 'automatic' mode, which is +recommended unless you know what you're doing. + +OgreMaterialUpgrade +------------------- +Upgrades a .material script from any previous version of OGRE to the new +.material format. Note that upgraded scripts do not use any new features of the +material, and you may find that some attributes are re-written as their +'complex' variants rather than their simplified versions (e.g. "scene_blend add" +will be written as "scene_blend one one" because this is what 'add' maps down +to. + +You only need to run this tool if you have .material scripts from a version of +OGRE older than 0.13.0. Material scripts written for 0.13.0 onwards do not +need upgrading. + +Usage: + +OgreMaterialUpgrade sourcefile [destfile] +sourcefile = name of file to convert +destfile = optional name of file to write to. If you don't + specify this OGRE overwrites the existing file. + +Again you can drag files onto this tool, so long as you don't mind it +overwriting the file in place. If you'd prefer to keep a backup, make a copy or +use the command line to upgrade to a different file. + +Copyright 2004 The OGRE Team Added: trunk/tools/OgreCommandLineTools/devil.dll =================================================================== (Binary files differ) Property changes on: trunk/tools/OgreCommandLineTools/devil.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/tools/OgreCommandLineTools/ilu.dll =================================================================== (Binary files differ) Property changes on: trunk/tools/OgreCommandLineTools/ilu.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/tools/OgreCommandLineTools/ilut.dll =================================================================== (Binary files differ) Property changes on: trunk/tools/OgreCommandLineTools/ilut.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/tools/OgreCommandLineTools/zlib1.dll =================================================================== (Binary files differ) Property changes on: trunk/tools/OgreCommandLineTools/zlib1.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-05 23:52:13
|
Revision: 85 http://roreditor.svn.sourceforge.net/roreditor/?rev=85&view=rev Author: rorthomas Date: 2007-07-05 16:52:07 -0700 (Thu, 05 Jul 2007) Log Message: ----------- * minor verbosity fixes Modified Paths: -------------- trunk/lib/ror/depchecker/ror_truck.py trunk/lib/ror/truckparser.py Modified: trunk/lib/ror/depchecker/ror_truck.py =================================================================== --- trunk/lib/ror/depchecker/ror_truck.py 2007-07-05 23:46:06 UTC (rev 84) +++ trunk/lib/ror/depchecker/ror_truck.py 2007-07-05 23:52:07 UTC (rev 85) @@ -3,7 +3,7 @@ def getDependencies(filename): p = rorparser() - p.parse(filename) + p.parse(filename, verbose=False) if not 'globals' in p.tree.keys(): print "truck parsing error on file " + filename truckfilename = os.path.basename(filename) Modified: trunk/lib/ror/truckparser.py =================================================================== --- trunk/lib/ror/truckparser.py 2007-07-05 23:46:06 UTC (rev 84) +++ trunk/lib/ror/truckparser.py 2007-07-05 23:52:07 UTC (rev 85) @@ -576,7 +576,7 @@ newcomment = {'data':[comment, attached], 'originline':lineno, 'section':section, 'type':'comment'} self.tree['comments'].append(newcomment) - def parse(self, filename): + def parse(self, filename, verbose = True): self.filename = filename content = None try: @@ -590,7 +590,8 @@ if content is None: sys.stderr.write("error while reading file!\n") sys.exit(1) - sys.stderr.write("processing file %s\n" % filename) + if verbose: + sys.stderr.write("processing file %s\n" % filename) self.tree = {'title':[]} actualsection = "title" prevsection = "" @@ -714,7 +715,8 @@ #self.checkNodes() #self.checkForDoubleNodes() #self.checkForDoubleBeams() - sys.stderr.write("finished processing of file %s\n" % filename) + if verbose: + sys.stderr.write("finished processing of file %s\n" % filename) #self.printtree() #self.linearizetree() #print self.tree['errors'] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-07-05 23:46:07
|
Revision: 84 http://roreditor.svn.sourceforge.net/roreditor/?rev=84&view=rev Author: rorthomas Date: 2007-07-05 16:46:06 -0700 (Thu, 05 Jul 2007) Log Message: ----------- * improved console usage Modified Paths: -------------- trunk/lib/ror/depchecker/ror_truck.py trunk/lib/ror/depchecker.py Modified: trunk/lib/ror/depchecker/ror_truck.py =================================================================== --- trunk/lib/ror/depchecker/ror_truck.py 2007-07-05 23:29:38 UTC (rev 83) +++ trunk/lib/ror/depchecker/ror_truck.py 2007-07-05 23:46:06 UTC (rev 84) @@ -9,7 +9,7 @@ truckfilename = os.path.basename(filename) truckname, ext = os.path.splitext(truckfilename) matname = p.tree['globals'][0]['data'][2] - print truckname + #print truckname return { "depends":{ "materials":[matname], Modified: trunk/lib/ror/depchecker.py =================================================================== --- trunk/lib/ror/depchecker.py 2007-07-05 23:29:38 UTC (rev 83) +++ trunk/lib/ror/depchecker.py 2007-07-05 23:46:06 UTC (rev 84) @@ -1,19 +1,17 @@ -#Thomas Fischer 31/05/2007, th...@th... +#Thomas Fischer 06/07/2007, th...@th... import sys, os, os.path #DIR = "C:\\games\\RoR-0.31a\\data" DEPCHECKPATH = "depchecker" class RoRDepChecker: - def __init__(self, path): + def __init__(self, path, mode): sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), DEPCHECKPATH)) self.deptree = {'materials':{},'file':{}} self.dir = path self.getfiles() self.createDepGraph() - self.viewDepGraph("all") - self.viewDepGraph("unused") - self.viewDepGraph("missing") + self.viewDepGraph(mode) def getDependencies(self, extension, filename): @@ -74,7 +72,12 @@ display = (len(req) > 0 and len(found) == 0) if display: displayedfiles += 1 - str += "%40s: %16s%-10s\n%41s %16s%-10s\n" % (k, "required by: ", reqstr, "", "provided by: ", foundstr) + if mode == "all": + str += "%40s: %16s%-10s\n%41s %16s%-10s\n" % (k, "required by: ", reqstr, "", "provided by: ", foundstr) + elif mode == "unused": + str += "%40s: %16s%-10s\n" % (k, "provided by: ", foundstr) + elif mode == "missing": + str += "%40s: %16s%-10s\n" % (k, "required by: ", reqstr) if displayedfiles > 0: print str elif displayedfiles == 0: @@ -109,9 +112,25 @@ # extlist.append(ext) #print extlist - + +def usage(): + print "usage: %s <path to inspect> <all or unused or missing>" % os.path.basename(sys.argv[0]) + print "for example: %s c:\\ror\\data missing" % os.path.basename(sys.argv[0]) + print " * all will display all dependencies, inclusive met ones" + print " * missing will display only unfulfilled dependencies" + print " * unused will display resources that are not in use" + sys.exit(0) + def main(): - RoRDepChecker(sys.argv[1]) + if len(sys.argv) != 3: + usage() + if not os.path.isdir(sys.argv[1]): + print "%s is not a valid directory!" % sys.argv[1] + usage() + if not sys.argv[2] in ['all', 'missing', 'unused']: + print "%s is not a valid mode!" % sys.argv[2] + usage() + RoRDepChecker(sys.argv[1], sys.argv[2]) if __name__ == "__main__": main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |