gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject cvs commit: jakarta-gump/python/gump/gui view.py
Date Mon, 24 Nov 2003 01:45:16 GMT
ajack       2003/11/23 17:45:16

  Modified:    python/gump engine.py
               python/gump/model module.py workspace.py project.py
                        depend.py
               python/gump/test/resources/full1 module4.xml download1.xml
                        module2.xml module1.xml module3.xml profile.xml
               python/gump/test model.py
               python/gump/gui view.py
  Added:       python/gump/test/resources/full1 module5.xml alias1.xml
  Log:
  1) Add a unit test for aliasing (e.g. jakarta-ant -> ant)
  2) Fixed the bug to fix 'jars' type inherit
  
  Revision  Changes    Path
  1.16      +17 -5     jakarta-gump/python/gump/engine.py
  
  Index: engine.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/engine.py,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- engine.py	23 Nov 2003 06:16:39 -0000	1.15
  +++ engine.py	24 Nov 2003 01:45:15 -0000	1.16
  @@ -228,7 +228,7 @@
   
           for module in run.getGumpSet().getModules():
       
  -            # If no CVS, nothing to sync   
  +            # If no CVS/SVN, nothing to sync   
               if not module.hasCvs() \
                   and not module.hasSvn(): continue
       
  @@ -237,12 +237,18 @@
                   sourcedir = os.path.abspath(os.path.join(workspace.getCvsDirectory(),module.name))
# todo allow override
                   destdir = os.path.abspath(workspace.getBaseDirectory())
           
  -                work=syncDirectories(workspace.noRSync,WORK_TYPE_SYNC,\
  -                dir.work,workspace.tmpdir,\
  -                sourcedir,destdir,module.name)
           
                   # Perform the sync...
  +                work=syncDirectories(workspace.noRSync,WORK_TYPE_SYNC,\
  +                        dir.work,workspace.tmpdir,\
  +                        sourcedir,destdir,module.name)
  +                        
  +                # :TODO: Get the repostiory & store this work there also
  +                # might as well...
  +                    
  +                # Store the work as done on this module
                   module.performedWork(work)
  +                
   
                   # Update Context w/ Results  
                   if not work.result.state==CMD_STATE_SUCCESS:
  @@ -347,14 +353,20 @@
           mkdirs=0
           for mkdir in project.xml.mkdir:   
           
  +            # ----------------------------------------------------------------
               # :TODO: HACK HACK HACK HACK HACK HACK HACK
  -            # Rsynch should delete these things, not allow
  +            # :TODO: HACK HACK HACK HACK HACK HACK HACK
  +            # :TODO: HACK HACK HACK HACK HACK HACK HACK
  +            # Rsync should delete these things, not allow
               # them to exist. We should NOT do this.
               basedir=os.path.abspath(project.getModule().getSourceDirectory() \
                                           or dir.base)
               dirToMake=os.path.abspath(os.path.join(basedir,mkdir.dir))
               if os.path.exists(dirToMake): continue
               # :TODO: HACK HACK HACK HACK HACK HACK HACK
  +            # :TODO: HACK HACK HACK HACK HACK HACK HACK
  +            # :TODO: HACK HACK HACK HACK HACK HACK HACK
  +            # ----------------------------------------------------------------
               
           
               cmd=project.getMkDirCommand(mkdir,mkdirs)
  
  
  
  1.12      +16 -5     jakarta-gump/python/gump/model/module.py
  
  Index: module.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/model/module.py,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- module.py	23 Nov 2003 06:16:38 -0000	1.11
  +++ module.py	24 Nov 2003 01:45:15 -0000	1.12
  @@ -272,7 +272,11 @@
           # Determine source directory
           self.srcdir=self.xml.srcdir or self.xml.name        
           self.absSrcDir=os.path.join(workspace.getBaseDirectory(),self.srcdir)
  -                                    
  +                               
  +                               
  +        # :TODO: Consolidate this code, less cut-n-paste but also
  +        # check the 'type' of the repository is appropriate for the
  +        # use (eg. type='cvs' if refrenced by CVS).
           if not packaged:
               # We have a CVS entry, expand it...
               if self.xml.cvs:
  @@ -285,7 +289,7 @@
                       self.cvs=ModuleCvs(self.xml.cvs,repo)
                   else:
                       self.changeState(STATE_FAILED,REASON_CONFIG_FAILED)               
  -                    log.error(':TODO: No such repository in w/s ['+ repoName +'] on ['
\
  +                    self.addError('No such repository in w/s ['+ repoName +'] on [' \
                               + self.getName() + ']')
                               
               elif self.xml.svn:                
  @@ -298,7 +302,7 @@
                       self.svn=ModuleSvn(self.xml.svn,repo)
                   else:
                       self.changeState(STATE_FAILED,REASON_CONFIG_FAILED)               
  -                    log.error(':TODO: No such repository in w/s ['+ repoName +'] on ['
\
  +                    self.addError('No such repository in w/s ['+ repoName +'] on [' \
                               + self.getName() + ']')                 
                                                   
               elif self.xml.jars:                
  @@ -311,9 +315,13 @@
                       self.svn=ModuleJars(self.xml.jars,repo)
                   else:
                       self.changeState(STATE_FAILED,REASON_CONFIG_FAILED)               
  -                    log.error(':TODO: No such repository in w/s ['+ repoName +'] on ['
\
  +                    self.addError('No such repository in w/s ['+ repoName +'] on [' \
                               + self.getName() + ']')                 
  -                    
  +
  +
  +        # For prettiness
  +        self.sortedProjects=createOrderedList(self.getProjects())
  +                            
           self.setComplete(1)            
           
       def addProject(self,project):
  @@ -325,6 +333,9 @@
           
       def getProjects(self):
           return self.projects.values()
  +        
  +    def getSortedProjects(self):
  +        return self.sortedProjects        
     
       def getChildren(self):
           return self.getProjects()        
  
  
  
  1.11      +42 -13    jakarta-gump/python/gump/model/workspace.py
  
  Index: workspace.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/model/workspace.py,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- workspace.py	23 Nov 2003 15:17:51 -0000	1.10
  +++ workspace.py	24 Nov 2003 01:45:15 -0000	1.11
  @@ -113,6 +113,12 @@
           self.startdatetime=time.strftime(setting.datetimeformat, \
                                   time.localtime())
           self.timezone=str(time.tzname)    
  +
  +    def getChildren(self):
  +        return self.getModules() 
  +    
  +
  +    # Repository Interface
       
       def hasRepository(self,rname):
           return self.repositories.has_key(rname)
  @@ -123,17 +129,41 @@
       def getRepositories(self):
           return self.repositories.values()
           
  +    def getSortedRepositories(self):
  +        return self.sortedRepositories
  +
  +
  +    # Module Interface
  +        
       def hasModule(self,mname):
           return self.modules.has_key(mname)
           
       def getModule(self,mname):
           return self.modules.get(mname,None)
  -        
  +
  +    def getModules(self):
  +        return self.modules.values()              
  +                
  +    def getSortedModules(self):
  +        return self.sortedModules   
  +                
  +                
  +    # All projects in the workspace (also available
  +    # through the owned moduleS)
  +                
       def hasProject(self,pname):
           return self.projects.has_key(pname)
           
       def getProject(self,pname):
           return self.projects[pname]
  +                
  +    def getProjects(self):
  +        return self.projects.values() 
  +                
  +    def getSortedProjects(self):
  +        return self.sortedProjects       
  +        
  +        
           
       def complete(self, xmlprofiles, xmlrepositories, xmlmodules, xmlprojects):        
           if self.isComplete(): return
  @@ -311,7 +341,15 @@
                                                                
           # Complete the properies
           self.completeProperties()
  -                                        
  +                                      
  +                                      
  +        # Sort contents (for 'prettiness')
  +        
  +        # Pretty sorting...
  +        self.sortedModules=createOrderedList(self.getModules())
  +        self.sortedProjects=createOrderedList(self.getProjects())
  +        self.sortedRepositories=createOrderedList(self.getRepositories())
  +        
           self.setComplete(1)
   
               
  @@ -361,20 +399,11 @@
               os.path.abspath(os.path.join(self.getBaseDirectory(),'log'))
               
       def getLogUrl(self):
  -        return self.logurl
  -            
  -    def getProjects(self):
  -        return self.projects.values()        
  +        return self.logurl            
       
       # :TODO: Inefficient, ought store sorted
       def getProjectIterator(self):
  -        return AlphabeticDictionaryIterator(self.projects)
  -        
  -    def getChildren(self):
  -        return self.getModules() 
  -    
  -    def getModules(self):
  -        return self.modules.values()    
  +        return AlphabeticDictionaryIterator(self.projects)        
           
       # :TODO: Inefficient, ought store sorted
       def getModuleIterator(self):
  
  
  
  1.16      +4 -4      jakarta-gump/python/gump/model/project.py
  
  Index: project.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/model/project.py,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- project.py	21 Nov 2003 05:06:37 -0000	1.15
  +++ project.py	24 Nov 2003 01:45:15 -0000	1.16
  @@ -803,11 +803,11 @@
       #
       # Return a (classpath, bootclaspath) tuple for this project
       #
  -    def getClasspaths(self):
  +    def getClasspaths(self,debug=0):
           #
           # Calculate classpath and bootclasspath
           #
  -        (classpath, bootclasspath) = self.getClasspathLists()
  +        (classpath, bootclasspath) = self.getClasspathLists(debug)
           
           #
           # Return them simple/flattened
  @@ -878,7 +878,7 @@
     
           # Does it have any depends? Process all of them...
           for dependency in self.getDependencies():
  -            (subcp, subbcp) = self.getDependOutputList(dependency,visited,0,debug)
  +            (subcp, subbcp) = self.getDependOutputList(dependency,visited,1,debug)
               self.importClasspaths(classpath,bootclasspath,subcp,subbcp)
       
           #
  @@ -992,7 +992,7 @@
               # If the dependent project inherited stuff, we inherit that...
               if    	(inherit==INHERIT_ALL or inherit==INHERIT_HARD) \
                       or (inherit==INHERIT_RUNTIME and subdependency.isRuntime()) \
  -                    or (subdependency.inherit):      
  +                    or (subdependency.inherit > INHERIT_NONE):      
                   (subcp, subbcp) = self.getDependOutputList(subdependency,visited,depth+1,debug)
                   self.importClasspaths(classpath,bootclasspath,subcp,subbcp)   
               elif debug:
  
  
  
  1.4       +14 -4     jakarta-gump/python/gump/model/depend.py
  
  Index: depend.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/model/depend.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- depend.py	20 Nov 2003 20:51:48 -0000	1.3
  +++ depend.py	24 Nov 2003 01:45:15 -0000	1.4
  @@ -72,12 +72,14 @@
   
   # Inheritence
   INHERIT_NONE=0
  -INHERIT_RUNTIME=1
  -INHERIT_ALL=2
  -INHERIT_HARD=3
  +INHERIT_JARS=1
  +INHERIT_RUNTIME=2
  +INHERIT_ALL=3
  +INHERIT_HARD=4
   
   inheritDescriptions = { INHERIT_NONE : "None",
              INHERIT_RUNTIME : "Runtime",
  +           INHERIT_JARS : "Jars",
              INHERIT_ALL : "All",
              INHERIT_HARD : "Hard" }
   
  @@ -98,6 +100,8 @@
           inherit=INHERIT_ALL
       elif 'hard' == xmldepend.inherit:
           inherit=INHERIT_HARD
  +    elif 'jars' == xmldepend.inherit:
  +        inherit=INHERIT_JARS
       elif 'none' == xmldepend.inherit:
           inherit=INHERIT_NONE
           
  @@ -140,8 +144,14 @@
           if not c: c = cmp(self.ids,other.ids)
           return c
       
  +    def __repr__(self):
  +        return str(self)
  +        
       def __str__(self):
  -        output=self.project.getName()
  +        output='[owner=\''+ self.owner.getName() + '\'] '
  +        
  +        output+='project=\''+ self.project.getName() + '\''
  +        
           if self.inherit:
               output+=' inherit=\'' + self.getInheritenceDescription() + '\''
           if self.runtime:
  
  
  
  1.2       +1 -1      jakarta-gump/python/gump/test/resources/full1/module4.xml
  
  Index: module4.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/test/resources/full1/module4.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- module4.xml	21 Nov 2003 19:04:10 -0000	1.1
  +++ module4.xml	24 Nov 2003 01:45:15 -0000	1.2
  @@ -20,7 +20,7 @@
   
       <home nested="dist"/>
   
  -    <jar name="lib/output.jar" id="output"/>
  +    <jar name="lib/output4.jar" id="output4"/>
   
       <license name="LICENSE"/>
   
  
  
  
  1.2       +1 -7      jakarta-gump/python/gump/test/resources/full1/download1.xml
  
  Index: download1.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/test/resources/full1/download1.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- download1.xml	23 Nov 2003 06:16:39 -0000	1.1
  +++ download1.xml	24 Nov 2003 01:45:15 -0000	1.2
  @@ -24,12 +24,6 @@
       <nag from="Gump Integration Build &lt;dev@ant.apache.org&gt;"
            to="dev@ant.apache.org"/>
     </project>
  -  
  -  <project name="honorary1">
  -    <package>org.apache.tools.ant</package>
  -    <depend project="random"/>
  -    <option project="random"/>
  -    <home nested="dist"/>
  -  </project>
  +
   </module>
   
  
  
  
  1.2       +1 -1      jakarta-gump/python/gump/test/resources/full1/module2.xml
  
  Index: module2.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/test/resources/full1/module2.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- module2.xml	21 Nov 2003 19:04:10 -0000	1.1
  +++ module2.xml	24 Nov 2003 01:45:15 -0000	1.2
  @@ -19,7 +19,7 @@
   
       <home nested="dist"/>
   
  -    <jar name="lib/output.jar" id="output"/>
  +    <jar name="lib/output2.jar" id="output2"/>
   
       <license name="LICENSE"/>
   
  
  
  
  1.2       +1 -1      jakarta-gump/python/gump/test/resources/full1/module1.xml
  
  Index: module1.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/test/resources/full1/module1.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- module1.xml	21 Nov 2003 19:04:10 -0000	1.1
  +++ module1.xml	24 Nov 2003 01:45:15 -0000	1.2
  @@ -16,7 +16,7 @@
   
       <home nested="dist"/>
   
  -    <jar name="lib/output.jar" id="output"/>
  +    <jar name="lib/output1.jar" id="output1"/>
   
       <license name="LICENSE"/>
   
  
  
  
  1.2       +1 -1      jakarta-gump/python/gump/test/resources/full1/module3.xml
  
  Index: module3.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/test/resources/full1/module3.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- module3.xml	21 Nov 2003 19:04:10 -0000	1.1
  +++ module3.xml	24 Nov 2003 01:45:15 -0000	1.2
  @@ -19,7 +19,7 @@
   
       <home nested="dist"/>
   
  -    <jar name="lib/output.jar" id="output"/>
  +    <jar name="lib/output3.jar" id="output3"/>
   
       <license name="LICENSE"/>
   
  
  
  
  1.2       +3 -0      jakarta-gump/python/gump/test/resources/full1/profile.xml
  
  Index: profile.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/test/resources/full1/profile.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- profile.xml	21 Nov 2003 19:04:10 -0000	1.1
  +++ profile.xml	24 Nov 2003 01:45:15 -0000	1.2
  @@ -1,10 +1,13 @@
   <profile name="gump">
   
     <module href="package1.xml"/>
  +  <module href="download1.xml"/>
  +  <module href="alias1.xml"/>
     <module href="module1.xml"/>
     <module href="module2.xml"/>
     <module href="module3.xml"/>
     <module href="module4.xml"/>
  +  <module href="module5.xml"/>
     <module href="svn_module1.xml"/>
   
     <!-- Repository definitions -->
  
  
  
  1.1                  jakarta-gump/python/gump/test/resources/full1/module5.xml
  
  Index: module5.xml
  ===================================================================
  <module name="module5">
  
    <url  href="http://ant.apache.org/index.html"/>
    <description>
      Java based build tool
    </description>
  
    <cvs repository="repository1"/>
  
    <project name="project5">
      <package>org.apache.tools.ant</package>
  
      <depend project="alias1"/>
  
      <home nested="dist"/>
      <work nested="classes" />
  
      <jar name="lib/output.jar" id="output"/>
  
      <license name="LICENSE"/>
  
      <nag from="Gump Integration Build &lt;dev@ant.apache.org&gt;"
           to="dev@ant.apache.org"/>
    </project>
  </module>
  
  
  
  
  1.1                  jakarta-gump/python/gump/test/resources/full1/alias1.xml
  
  Index: alias1.xml
  ===================================================================
  <module name="alias1">
  
    <url  href="http://ant.apache.org/index.html"/>
    <description>
      Java based build tool
    </description>
  
    <jars repository="jars_repository1"/>
  
    <project name="alias1">
      <depend project="project4" inherit="jars"/>
    </project>
  
  </module>
  
  
  
  
  1.6       +11 -0     jakarta-gump/python/gump/test/model.py
  
  Index: model.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/test/model.py,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- model.py	23 Nov 2003 06:16:39 -0000	1.5
  +++ model.py	24 Nov 2003 01:45:16 -0000	1.6
  @@ -93,6 +93,8 @@
           self.project2=self.workspace.getProject('project2')             
           self.project3=self.workspace.getProject('project3')
           self.project4=self.workspace.getProject('project4')
  +        self.project5=self.workspace.getProject('project5')
  +        self.alias1=self.workspace.getProject('alias1')
           
           self.packagedModule1=self.workspace.getModule('package1')        
           self.module1=self.workspace.getModule('module1')
  @@ -187,4 +189,13 @@
           
           self.assertEqual('State ought propagate to here', project4.getState(), STATE_PREREQ_FAILED)
           self.assertNotEqual('State ought NOT propagate like this', project4.getState(),
STATE_FAILED)
  +        
  +    def testClasspaths(self):
  +        
  +        (classpath,bootclasspath)=self.project1.getClasspaths()
  +        (classpath,bootclasspath)=self.project4.getClasspaths()
  +        (classpath,bootclasspath)=self.alias1.getClasspaths()
  +        (classpath,bootclasspath)=self.project5.getClasspaths(1)        
  +        print "Classpath:" + classpath     
  +        print "Bootclasspath:" + bootclasspath
           
  
  
  
  1.2       +41 -41    jakarta-gump/python/gump/gui/view.py
  
  Index: view.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/gui/view.py,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- view.py	17 Nov 2003 22:10:56 -0000	1.1
  +++ view.py	24 Nov 2003 01:45:16 -0000	1.2
  @@ -74,12 +74,15 @@
   # http://wxpython.org/
   from wxPython.wx import *
   
  -from gump import load, log
  -from gump.conf import dir, default, handleArgv
  -from gump.xmlutils import xmlize
  -from gump.model import Module, Project
  -from gump.logic import *
  -from gump.build import build
  +from gump import log
  +from gump.config import dir, default
  +from gump.utils.xmlutils import xmlize
  +from gump.utils.commandLine import handleArgv
  +from gump.model.module import Module
  +from gump.model.project import Project
  +from gump.model.workspace import Workspace
  +from gump.model.loader import WorkspaceLoader
  +from gump.engine import GumpEngine
   
   ###############################################################################
   # Initialize
  @@ -132,24 +135,24 @@
                                           wxNO_BORDER | wxTB_FLAT )
   
       self.frame.toolbar.AddSimpleTool(self.menu_BACK,
  -                                     wxBitmap("gump/images/back.bmp",
  +                                     wxBitmap("gump/gui/images/back.bmp",
                                                 wxBITMAP_TYPE_BMP),
                                        "Back")
     
       self.frame.toolbar.AddSeparator()
   
       self.frame.toolbar.AddSimpleTool(self.menu_UPDATE,
  -                                     wxBitmap("gump/images/update.bmp",
  +                                     wxBitmap("gump/gui/images/update.bmp",
                                                 wxBITMAP_TYPE_BMP),
                                        "Update from VCS")
                                        
       self.frame.toolbar.AddSimpleTool(self.menu_GEN,
  -                                     wxBitmap("gump/images/gen.bmp",
  +                                     wxBitmap("gump/gui/images/gen.bmp",
                                                 wxBITMAP_TYPE_BMP),
                                        "Generate XML merged descriptor")
                                        
       self.frame.toolbar.AddSimpleTool(self.menu_RUN,
  -                                     wxBitmap("gump/images/run.bmp",
  +                                     wxBitmap("gump/gui/images/run.bmp",
                                                 wxBITMAP_TYPE_BMP),
                                        "Run")
   
  @@ -157,12 +160,12 @@
   
   
       self.frame.toolbar.AddCheckTool(self.menu_CONSOLE,
  -                                     wxBitmap("gump/images/console.bmp",
  +                                     wxBitmap("gump/gui/images/console.bmp",
                                                 wxBITMAP_TYPE_BMP),
                                        shortHelp="Toggle this")
       
       self.frame.toolbar.AddSimpleTool(self.menu_HELP,
  -                                     wxBitmap("gump/images/help.bmp",
  +                                     wxBitmap("gump/gui/images/help.bmp",
                                                 wxBITMAP_TYPE_BMP),
                                        "Help")
       
  @@ -176,12 +179,12 @@
       
       #notebook images
       notebookil = wxImageList(16, 16)
  -    idx_referenced = notebookil.Add(wxImage("gump/images/referenced.bmp").ConvertToBitmap())
  -    idx_dependencies = notebookil.Add(wxImage("gump/images/dependencies.bmp").ConvertToBitmap())
  -    idx_prereqs = notebookil.Add(wxImage("gump/images/prereqs.bmp").ConvertToBitmap())
  -    idx_classpath = notebookil.Add(wxImage("gump/images/classpath.bmp").ConvertToBitmap())
  -    idx_property = notebookil.Add(wxImage("gump/images/property.bmp").ConvertToBitmap())
   
  -    idx_exports = notebookil.Add(wxImage("gump/images/exports.bmp").ConvertToBitmap())
   
  +    idx_referenced = notebookil.Add(wxImage("gump/gui/images/referenced.bmp").ConvertToBitmap())
  +    idx_dependencies = notebookil.Add(wxImage("gump/gui/images/dependencies.bmp").ConvertToBitmap())
  +    idx_prereqs = notebookil.Add(wxImage("gump/gui/images/prereqs.bmp").ConvertToBitmap())
  +    idx_classpath = notebookil.Add(wxImage("gump/gui/images/classpath.bmp").ConvertToBitmap())
  +    idx_property = notebookil.Add(wxImage("gump/gui/images/property.bmp").ConvertToBitmap())
   
  +    idx_exports = notebookil.Add(wxImage("gump/gui/images/exports.bmp").ConvertToBitmap())
   
       notebook.AssignImageList(notebookil)
       #self.SetImageList(self.il, wxIMAGE_LIST_SMALL)
   
  @@ -252,11 +255,11 @@
         
       #tree images
       treeil = wxImageList(16, 16)
  -    idx_workspace = treeil.Add(wxImage("gump/images/workspace.bmp").ConvertToBitmap())
  -    idx_module = treeil.Add(wxImage("gump/images/module.bmp").ConvertToBitmap())
  -    idx_module_ex = treeil.Add(wxImage("gump/images/module_ex.bmp").ConvertToBitmap())
   
  -    idx_project = treeil.Add(wxImage("gump/images/project.bmp").ConvertToBitmap())
  -    idx_project_ex = treeil.Add(wxImage("gump/images/project_ex.bmp").ConvertToBitmap())
  +    idx_workspace = treeil.Add(wxImage("gump/gui/images/workspace.bmp").ConvertToBitmap())
  +    idx_module = treeil.Add(wxImage("gump/gui/images/module.bmp").ConvertToBitmap())
  +    idx_module_ex = treeil.Add(wxImage("gump/gui/images/module_ex.bmp").ConvertToBitmap())
   
  +    idx_project = treeil.Add(wxImage("gump/gui/images/project.bmp").ConvertToBitmap())
  +    idx_project_ex = treeil.Add(wxImage("gump/gui/images/project_ex.bmp").ConvertToBitmap())
       self.tree.AssignImageList(treeil)
       
       root = self.tree.AddRoot(files[0])
  @@ -264,20 +267,20 @@
       self.tree.SetItemImage(root, idx_workspace, wx.wxTreeItemIcon_Expanded)
       self.tree.SetItemImage(root, idx_workspace, wx.wxTreeItemIcon_SelectedExpanded)
       
  -    self.workspace = load(files[0])
  +    # Load (and complete) the workspace
  +    self.workspace = (WorkspaceLoader()).load(files[0])
       
  -    names=Module.list.keys()
  -    names.sort()
  -    for name in names:
  -      module=Module.list[name]
  +    # Build the view tree of modules/projects
  +    for module in self.workspace.getSortedModules():
  +      name=module.getName()
         parent=self.mItem[name]=self.tree.AppendItem(root,name)
         self.tree.SetPyData(parent,module)
         self.tree.SetItemImage(parent, idx_module ,    wx.wxTreeItemIcon_Normal)
         self.tree.SetItemImage(parent, idx_module_ex , wx.wxTreeItemIcon_Expanded)
         self.tree.SetItemImage(parent, idx_module_ex , wx.wxTreeItemIcon_Selected)
         self.tree.SetItemImage(parent, idx_module_ex,  wx.wxTreeItemIcon_SelectedExpanded)
  -      for project in module.project:
  -        proj=self.pItem[project.name]=self.tree.AppendItem(parent,project.name)
  +      for project in module.getSortedProjects():
  +        proj=self.pItem[project.getName()]=self.tree.AppendItem(parent,project.getName())
           self.tree.SetPyData(self.pItem[project.name],project)
           self.tree.SetItemImage(proj, idx_project ,    wx.wxTreeItemIcon_Normal)
           self.tree.SetItemImage(proj, idx_project_ex , wx.wxTreeItemIcon_Selected)
  @@ -348,11 +351,8 @@
   
       # gather a list of projects which reference this project
       self.items=[]
  -    for parent in Project.list.values():
  -      list=parent.depend+parent.option
  -      for depend in list:
  -        if depend.project==project.name:
  -          self.items.append(parent.name)
  +    for dependency in project.getDependees():
  +        self.items.append(dependency.getOwnerProject().getName())
   
       # display the list, sorted by name
       self.list.DeleteAllItems()
  @@ -508,7 +508,7 @@
           
   class GumpSplashScreen(wxSplashScreen):
     def __init__(self):
  -    bmp = wxImage("gump/images/gump.bmp").ConvertToBitmap()
  +    bmp = wxImage("gump/gui/images/gump.bmp").ConvertToBitmap()
       wxSplashScreen.__init__(self, bmp,
                               wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
                               4000, None, -1,
  @@ -524,11 +524,11 @@
           self.logmsg = []
           
           self.il = wxImageList(16, 16)
  -        self.idx_critical = self.il.Add(wxImage("gump/images/fatal.bmp").ConvertToBitmap())
  -        self.idx_error = self.il.Add(wxImage("gump/images/error.bmp").ConvertToBitmap())
  -        self.idx_warning = self.il.Add(wxImage("gump/images/warning.bmp").ConvertToBitmap())
  -        self.idx_info = self.il.Add(wxImage("gump/images/info.bmp").ConvertToBitmap())
  -        self.idx_debug = self.il.Add(wxImage("gump/images/debug.bmp").ConvertToBitmap())
  +        self.idx_critical = self.il.Add(wxImage("gump/gui/images/fatal.bmp").ConvertToBitmap())
  +        self.idx_error = self.il.Add(wxImage("gump/gui/images/error.bmp").ConvertToBitmap())
  +        self.idx_warning = self.il.Add(wxImage("gump/gui/images/warning.bmp").ConvertToBitmap())
  +        self.idx_info = self.il.Add(wxImage("gump/gui/images/info.bmp").ConvertToBitmap())
  +        self.idx_debug = self.il.Add(wxImage("gump/gui/images/debug.bmp").ConvertToBitmap())
           self.SetImageList(self.il, wxIMAGE_LIST_SMALL)
    
           self.attr_critical = wxListItemAttr()
  
  
  

Mime
View raw message