You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@gump.apache.org by aj...@apache.org on 2004/03/09 20:57:07 UTC

cvs commit: gump/python/gump/gui view.py

ajack       2004/03/09 11:57:07

  Modified:    python/gump/model project.py depend.py module.py object.py
               python/gump/utils work.py tools.py sync.py
               python/gump/document forrest.py text.py
               python/gump gumprun.py engine.py integrate.py
               python/gump/gui view.py
  Added:       python   profileView.py
  Log:
  1) Created DependSet/Dependable to clean up dependency/dependee counts
  2) Migrated to Sync/Copy (from rsync)
  
  Ready to test...
  
  Revision  Changes    Path
  1.62      +15 -144   gump/python/gump/model/project.py
  
  Index: project.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/model/project.py,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- project.py	7 Mar 2004 22:22:35 -0000	1.61
  +++ project.py	9 Mar 2004 19:57:06 -0000	1.62
  @@ -180,13 +180,14 @@
           return os.pathsep.join(self.getSimpleClasspathList())
               
   
  -class Project(NamedModelObject, Statable, Resultable):
  +class Project(NamedModelObject, Statable, Resultable, Dependable):
       """A single project"""
       def __init__(self,xml,workspace):
       	NamedModelObject.__init__(self,xml.getName(),xml,workspace)
       	
       	Statable.__init__(self)
       	Resultable.__init__(self)
  +    	Dependable.__init__(self)
       	
       	# Navigation
           self.module=None # Module has to claim ownership
  @@ -197,21 +198,7 @@
       	
       	self.license=None
       	
  -    	#############################################################
  -    	# Dependency Trees
  -    	#
  -    	
  -    	# Those which we rely upon...
  -    	self.depends=[]
  -    	
  -    	# Those which rely upon us...
  -    	self.dependees=[]
  -    	
  -    	#
  -    	# Fully expanded
  -    	#
  -    	self.fullDepends=[]
  -    	self.fullDependees=[]    
  +    	self.affected=0
           
       	#############################################################
       	#
  @@ -317,60 +304,6 @@
           
       def getReports(self):
           return self.reports
  -    
  -    def getDependencies(self):
  -        return self.depends
  -        
  -    def getDependencyCount(self):   
  -        """ Count the direct depenencies """
  -        return len(self.depends)
  -        
  -    def getDependees(self):
  -        return self.dependees
  -        
  -    def getDependeeCount(self):   
  -        """ Count the direct dependees """
  -        return len(self.dependees)
  -        
  -    def getFullDependencies(self):   
  -        #
  -        # Build a set of dependencies (once only)
  -        #
  -        if self.fullDepends: 
  -            return self.fullDepends
  -        
  -        for dependency in self.depends:
  -            if not dependency in self.fullDepends: 
  -                self.fullDepends.append(dependency)
  -                for subdepend in dependency.getProject().getFullDependencies():
  -                    if not subdepend in self.fullDepends:
  -                        self.fullDepends.append(subdepend)
  -        self.fullDepends.sort()
  -        
  -        # Return stored
  -        return self.fullDepends
  -                    
  -    def getFullDependencyCount(self):         
  -        return len(self.getFullDependencies())                      
  -    
  -    def getFullDependees(self):   
  -        if self.fullDependees: return self.fullDependees
  -        
  -        for dependee in self.dependees:
  -            if not dependee in self.fullDependees: 
  -                # We have a new dependee
  -                self.fullDependees.append(dependee)
  -                for subdependee in dependee.getOwnerProject().getFullDependees():
  -                    if not subdependee in self.fullDependees:
  -                        self.fullDependees.append(subdependee)
  -        self.fullDependees.sort()
  -        
  -        # Store once
  -        return self.fullDependees            
  -                        
  -    def getFullDependeeCount(self):         
  -        return len(self.getFullDependees())             
  -        
       def getFOGFactor(self):
           return self.getStats().getFOGFactor()
           
  @@ -379,13 +312,10 @@
           return self.getModule().getStats().getLastUpdated()  
           
       def determineAffected(self):
  -        affected=0
  -        
  -        # Get all dependenees (optional/otherwise)
  -        fullDependees=self.getFullDependees()
  +        if self.affected: return self.affected
           
           # Look through all dependees
  -        for dependee in fullDependees:
  +        for dependee in self.getFullDependees():
               project=dependee.getOwnerProject()
               
               cause=project.getCause()
  @@ -397,9 +327,9 @@
                   # The something was this module or one of it's projects
                   #
                   if cause == self:
  -                    affected += 1            
  +                    self.affected += 1            
           
  -        return affected
  +        return self.affected
           
       def propagateErrorStateChange(self,state,reason,cause,message):
           
  @@ -407,7 +337,7 @@
           # Mark depend*ee*s as failed for this cause...
           # Warn option*ee*s
           #
  -        for dependee in self.getDependees():  
  +        for dependee in self.getDirectDependees():  
       
               # This is a backwards link, so use the owner
               dependeeProject=dependee.getOwnerProject()
  @@ -567,7 +497,7 @@
           if not packaged:
               # Complete dependencies so properties can reference the,
               # completed metadata within a dependent project
  -            for dependency in self.getDependencies():
  +            for dependency in self.getDirectDependencies():
                   dependency.getProject().complete(workspace)
   
               self.buildDependenciesMap(workspace)                        
  @@ -670,66 +600,6 @@
   
           return (badDepends, badOptions)
           
  -    def buildDependenciesMap(self,workspace):        
  -        
  -        #
  -        # Provide backwards links  [Note: ant|maven might have added some
  -        # dependencies, so this is done here * not just with the direct
  -        # xml depend/option elements]
  -        #
  -        for dependency in self.getDependencies():
  -            dependProject=dependency.getProject()
  -            # Add us as a dependee on them
  -            dependProject.addDependee(dependency)  
  -                        
  -                                
  -    def addDependency(self,dependency):
  -        #
  -        # TODO check this against any matching dependency
  -        # not equal?
  -        #
  -        if not dependency in self.depends:
  -            if not dependency.getProject()==self:
  -                self.depends.append(dependency)
  -            #else:
  -            #    print 'Not Adding : ' + dependency
  -
  -    def addDependee(self,dependency):
  -        #
  -        # TODO check this against any matching dependency
  -        # not equal?
  -        #
  -        if not dependency in self.dependees:
  -            if not dependency.getOwnerProject()==self:
  -                self.dependees.append(dependency)
  -            #else:
  -            #    print 'Not Adding : ' + dependency
  -
  -    # 
  -    def hasFullDependencyOnNamedProject(self,name):
  -        for dependency in self.depends:
  -            if dependency.getProject().getName()==name: 
  -                return 1
  -                
  -# :TODO:        
  -#           and not dependency.noclasspath: return 1
  -#:TODO: noclasspath????
  -
  -        return 0
  -              
  -    # determine if this project is a prereq of any project on the todo list
  -    def hasDirectDependencyOn(self,project):
  -        for dependency in self.depends:
  -            if dependency.getProject()==project: return 1
  -    
  -    def hasDirectDependee(self,project):
  -        for dependee in self.dependees:
  -            if dependee.getOwnerProject()==project: return 1
  -            
  -    def hasDependee(self,project):
  -        for dependee in self.getFullDependees():
  -            if dependee.getOwnerProject()==project: return 1
  -            
       def hasBaseDirectory(self):
           if hasattr(self,'basedir') and self.basedir: return 1
           return 0
  @@ -1213,7 +1083,7 @@
           visited=[]
     
           # Does it have any depends? Process all of them...
  -        for dependency in self.getDependencies():
  +        for dependency in self.getDirectDependencies():
               (subcp, subbcp) = self.getDependOutputList(dependency,visited,1,debug)
               self.importClasspaths(classpath,bootclasspath,subcp,subbcp)
       
  @@ -1322,7 +1192,7 @@
                             + "] for dependency on [" + project.getName() + "]")
   
           # Append sub-projects outputs, if inherited
  -        for subdependency in project.getDependencies():        
  +        for subdependency in project.getDirectDependencies():        
               #	If the dependency is set to 'all' (or 'hard') we inherit all dependencies
               # If the dependency is set to 'runtime' we inherit all runtime dependencies
               # If the dependent project inherited stuff, we inherit that...
  @@ -1346,6 +1216,7 @@
               classpath.importClasspath(cp)                
           if bcp:
               bootclasspath.importClasspath(bcp)                      
  +
   
   class ProjectStatistics(Statistics):
       """Statistics Holder"""
  
  
  
  1.9       +164 -4    gump/python/gump/model/depend.py
  
  Index: depend.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/model/depend.py,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- depend.py	5 Feb 2004 14:50:07 -0000	1.8
  +++ depend.py	9 Mar 2004 19:57:06 -0000	1.9
  @@ -218,4 +218,164 @@
           
           return result
           
  -           
  \ No newline at end of file
  +
  +class DependSet:
  +
  +    """ A dependency set contains dependencies between projects """
  +    def __init__(self, dependees=0):
  +        
  +        # A list of all dependencies
  +        self.depends=[]
  +        
  +        # A map by project -> dependencies list
  +        self.projectMap={}
  +        
  +        # Which direction (to or from?)
  +        self.dependees=dependees
  +        
  +    def addDepend(self, depend):
  +        
  +        #
  +        # Add to total list
  +        #
  +        self.depends.append(depend)
  +                
  +        #
  +        # Store depend by project key
  +        #
  +        dependProject=None
  +        if self.dependees:
  +            dependPRoejct = depend.getOwnerProject()
  +        else:
  +            dependProject = depend.getProject()        
  +        if not self.projectMap.has_key(dependProject):
  +            self.projectMap[dependProject] = []            
  +        self.projectMap[dependProject] = depend
  +        
  +    def containsDepend(self, depend):
  +        return (depend in self.depends)
  +        
  +    def getDepends(self):
  +        return self.depends
  +        
  +    def getUniqueProjectDependCount(self):
  +        return len(self.projectMap)
  +                
  +class Dependable:
  +    
  +    """ Direct and Full Dependencies """
  +    def __init__(self):
  +        
  +        # Direct & Full Dependencies
  +        self.directDependencies=DependSet()
  +        self.fullDependencies=None
  +        
  +        # Direct & Full Dependees
  +        self.directDependees=DependSet()
  +        self.fullDependees=None
  +        
  +    #
  +    # Dependencies
  +    # 
  +    def addDependency(self,depend):
  +        self.directDependencies.addDepend(depend)
  +            
  +    def getDirectDependencies(self):
  +        return self.directDependencies.getDepends()
  +        
  +    def getFullDependencies(self):
  +        if self.fullDependencies: return self.fullDependencies.getDepends()
  +        
  +        #
  +        # Build (once) upon demand
  +        #
  +        self.fullDependencies=DependSet()
  +        for depend in self.directDependencies.getDepends():
  +            if not self.fullDependencies.containsDepend(depend):
  +                self.fullDependencies.addDepend(depend)
  +                # Get Sub Dependencies
  +                for subdepend in depend.getProject().getFullDependencies():
  +                    if not self.fullDependencies.containsDepend(subdepend):
  +                        self.fullDependencies.addDepend(depend)
  +            
  +        return self.fullDependencies.getDepends()
  +                
  +    def getDependencyCount(self):
  +        return self.directDependencies.getUniqueProjectDependCount()
  +        
  +    def getFullDependencyCount(self):
  +        return self.fullDependencies.getUniqueProjectDependCount()
  +                
  +    #
  +    # Dependees
  +    # 
  +    def addDependee(self,depend):
  +        self.directDependees.addDepend(depend)
  +            
  +    def getDirectDependees(self):
  +        return self.directDependees.getDepends()
  +        
  +    def getFullDependees(self):
  +        if self.fullDependees: return self.fullDependees.getDepends()
  +        
  +        #
  +        # Build (once) upon demand
  +        #
  +        self.fullDependees=DependSet()
  +        for depend in self.directDependees.getDepends():
  +            if not self.fullDependees.containsDepend(depend):    
  +                self.fullDependees.addDepend(depend)
  +                # Get Sub Dependees
  +                for subdepend in depend.getProject().getFullDependees():
  +                    if not self.fullDependees.containsDepend(subdepend):    
  +                        self.fullDependees.addDepend(depend)
  +            
  +        return self.fullDependees.getDepends()
  +        
  +    def getDependeeCount(self):
  +        return self.directDependees.getUniqueProjectDependCount()
  +                
  +    def getFullDependeeCount(self):
  +        return self.fullDependees.getUniqueProjectDependCount()
  +        
  +        
  +    def buildDependenciesMap(self,workspace):        
  +        
  +        #
  +        # Provide backwards links  [Note: ant|maven might have added some
  +        # dependencies, so this is done here * not just with the direct
  +        # xml depend/option elements]
  +        #
  +        for dependency in self.getDirectDependencies():
  +            dependProject=dependency.getProject()
  +            # Add us as a dependee on them
  +            dependProject.addDependee(dependency)  
  +                                                        
  +    # 
  +    def hasFullDependencyOnNamedProject(self,name):
  +        for dependency in self.getDirectDependencies():
  +            if dependency.getProject().getName()==name: 
  +                return 1
  +                
  +# :TODO:        
  +#           and not dependency.noclasspath: return 1
  +#:TODO: noclasspath????
  +
  +        return 0
  +
  +    # determine if this project is a prereq of any project on the todo list
  +    def hasDirectDependencyOn(self,project):
  +        for dependency in self.dependencies:
  +            if dependency.getProject()==project: return 1
  +    
  +    def hasDirectDependee(self,project):
  +        for dependee in self.dependees:
  +            if dependee.getOwnerProject()==project: return 1
  +            
  +    def hasDependee(self,project):
  +        for dependee in self.getFullDependees():
  +            if dependee.getOwnerProject()==project: return 1
  +                    
  +        
  +        
  +        
  \ No newline at end of file
  
  
  
  1.37      +9 -9      gump/python/gump/model/module.py
  
  Index: module.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/model/module.py,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- module.py	5 Mar 2004 23:42:22 -0000	1.36
  +++ module.py	9 Mar 2004 19:57:06 -0000	1.37
  @@ -222,6 +222,8 @@
       	
           self.packaged		=	0
       	self.updated		=	0
  +    	
  +    	self.affected		=	0
           	
           # Extract settings
           self.tag			=	xml.tag
  @@ -480,13 +482,11 @@
           return summary
              
       def determineAffected(self):
  -        affected=0
           
  -        # Get all dependenees (optional/otherwise)
  -        dependees=self.getFullDependees()
  +        if self.affected: return self.affected
           
           # Look through all dependees
  -        for project in dependees:
  +        for project in self.getFullDependees():
               cause=project.getCause()
               #
               # Something caused this some grief
  @@ -496,9 +496,9 @@
                   # The something was this module or one of it's projects
                   #
                   if cause == self or cause in self.getProjects():
  -                    affected += 1            
  +                    self.affected += 1            
           
  -        return affected
  +        return self.affected
                      
       def getProjectStatistics(self,db=None):
           if not hasattr(self,'stats'):
  
  
  
  1.21      +7 -4      gump/python/gump/model/object.py
  
  Index: object.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/model/object.py,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- object.py	7 Mar 2004 22:22:35 -0000	1.20
  +++ object.py	9 Mar 2004 19:57:06 -0000	1.21
  @@ -189,7 +189,10 @@
           self.verbose=verbose
          
       def isVerbose(self):
  -        return self.verbose or self.xml.verbose      
  +        return self.verbose or self.xml.verbose  
  +         
  +    def isVerboseOrDebug(self):
  +        return self.isVerbose() or self.isDebug()
           
       def dump(self, indent=0, output=sys.stdout):
           """ Display the contents of this object """
  
  
  
  1.10      +7 -9      gump/python/gump/utils/work.py
  
  Index: work.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/utils/work.py,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- work.py	17 Feb 2004 21:54:21 -0000	1.9
  +++ work.py	9 Mar 2004 19:57:06 -0000	1.10
  @@ -73,16 +73,14 @@
   WORK_TYPE_CHECK=1
   WORK_TYPE_CONFIG=2
   WORK_TYPE_UPDATE=3
  -WORK_TYPE_SYNC=4
  -WORK_TYPE_PREBUILD=5
  -WORK_TYPE_BUILD=6
  -WORK_TYPE_POSTBUILD=7
  -WORK_TYPE_DOCUMENT=8
  +WORK_TYPE_PREBUILD=4
  +WORK_TYPE_BUILD=5
  +WORK_TYPE_POSTBUILD=6
  +WORK_TYPE_DOCUMENT=7
   
   workTypeDescriptions = { 	WORK_TYPE_CHECK : "CheckEnvironment",
                   WORK_TYPE_CONFIG : "Config",
                   WORK_TYPE_UPDATE : "Update",
  -                WORK_TYPE_SYNC : "Synchronize",
                   WORK_TYPE_PREBUILD : "PreBuild",
                   WORK_TYPE_BUILD : "Build",
                   WORK_TYPE_POSTBUILD : "PostBuild",
  
  
  
  1.16      +19 -34    gump/python/gump/utils/tools.py
  
  Index: tools.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/utils/tools.py,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- tools.py	7 Mar 2004 22:22:35 -0000	1.15
  +++ tools.py	9 Mar 2004 19:57:06 -0000	1.16
  @@ -69,6 +69,7 @@
   from gump.utils.note import *
   from gump.utils.work import *
   from gump.utils.file import *
  +from gump.utils.sync import *
   from gump.utils.launcher import *
       
   def listDirectoryAsWork(workable,directory,name=None):
  @@ -190,36 +191,21 @@
       return reference.exists() and reference.isNotDirectory()
   
      
  -def syncDirectories(noRSync,type,cwddir,tmpdir,sourcedir,destdir,name=None):                
  -    # :TODO: Make this configurable (once again)
  -    #if not workspace.sync:
  -    #  workspace.sync = default.syncCommand
  -    
  -    if noRSync:
  -        cmd=Cmd('cp','sync_'+name,cwddir)
  -        cmd.addParameter('-Rfv')
  -        cmd.addParameter(sourcedir)
  -        cmd.addParameter(destdir)
  -    else:
  -        cmd=Cmd('rsync','rsync_'+name,cwddir)            
  -        cmd.addParameter('-r')
  -        cmd.addParameter('-a')
  -        # Keep it quiet...
  -        # cmd.addParameter('-v')
  -        # cmd.addParameter('-v')
  -        # cmd.addParameter('--stats')        
  -        cmd.addParameter('--delete')
  -        cmd.addParameter(sourcedir)
  -        cmd.addParameter(destdir)
  -
  -    log.debug(' ------ Sync\'ing : '+ name)
  -    
  -    # Perform the Sync
  -    cmdResult=execute(cmd,tmpdir)
  -
  -    work=CommandWorkItem(type,cmd,cmdResult)
  +def copyDirectories(sourcedir,destdir,annotatable=None):   
  +    try:
  +        copy=Copy(sourcedir,destdir)        
  +        copy.execute()    
  +    finally:
  +        if annotatable:
  +            transferAnnotations(copy, annotatable)        
       
  -    return work        
  +def syncDirectories(sourcedir,destdir,annotatable=None):                
  +    try:
  +        sync=Sync(sourcedir,destdir)        
  +        sync.execute()    
  +    finally:
  +        if annotatable:
  +            transferAnnotations(sync, annotatable)    
       
   def tailFile(file,lines):
       """ Return the last N lines of a file as a list """
  @@ -264,5 +250,4 @@
     # dump(log)
     
     if len(sys.argv) > 0:
  -    print tailFileToString(sys.argv[1], 5  )
  -  
  +    print tailFileToString(sys.argv[1], 5  )
  \ No newline at end of file
  
  
  
  1.3       +17 -8     gump/python/gump/utils/sync.py
  
  Index: sync.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/utils/sync.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- sync.py	9 Mar 2004 14:14:32 -0000	1.2
  +++ sync.py	9 Mar 2004 19:57:06 -0000	1.3
  @@ -71,6 +71,7 @@
   from gump.utils.file import *
   from gump.utils.launcher import *
   from gump.utils.note import *
  +
   class Sync(Annotatable):
       """
       this class can be used to sync two directories
  @@ -86,6 +87,7 @@
           self.sourcedir = sourcedir
           self.targetdir = targetdir
           self.copyflag = copyflag
  +        
       def execute(self):
           if self.copyflag:
               action = 'copy'
  @@ -122,9 +124,9 @@
           if not result:    
               os.makedirs(dst)
           if result:
  -            names2 = os.listdir(dst)
  -            self.removenonmatching(src, dst, names, names2)
  +            names2 = os.listdir(dst)            
               if not self.copyflag:    
  +                self.removenonmatching(src, dst, names, names2)
                   self.epurate(src, dst, names, names2)    
           for name in names:
               srcname = os.path.join(src, name)
  @@ -141,6 +143,7 @@
                   message = "Can't copy [%s] to [%s]: [%s]" % (`srcname`, `dstname`, str(why))
                   log.exception(message)
                   raise IOError, message
  +                
       def epurate(self, sourcedir, destdir, acceptablefiles, existingfiles):        
           """
           this routine will delete from a set of existing files
  @@ -216,7 +219,13 @@
               okcopy = 1
           if okcopy:
               log.debug("Attempting copy from [%s] to [%s]" %(`srcname`, `dstname`))    
  -            shutil.copy2(srcname, dstname)
  -        
  -            
  +            shutil.copy2(srcname, dstname)        
  +
  +class Copy(Sync):
  +    """
  +    A Sync without the epurate
  +    """
  +    def __init__(self, sourcedir, targetdir):
  +        Sync.__init__(self, sourcedir, targetdir, 1)
  +                    
               
  
  
  
  1.97      +44 -64    gump/python/gump/document/forrest.py
  
  Index: forrest.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/document/forrest.py,v
  retrieving revision 1.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- forrest.py	8 Mar 2004 22:28:08 -0000	1.96
  +++ forrest.py	9 Mar 2004 19:57:06 -0000	1.97
  @@ -78,6 +78,7 @@
   from gump.document.resolver import *
   from gump.utils import *
   from gump.utils.xmlutils import xmlize
  +from gump.utils.tools import syncDirectories,copyDirectories
   from gump.model import *
   from gump.model.stats import *
   from gump.model.project import AnnotatedPath,  ProjectStatistics
  @@ -138,49 +139,24 @@
           return fdir  
       
       def seedForrest(self,workspace):   
  +        """ 
           
  -        forrestParentDir=self.getForrestParentDirectory(workspace)    
  +        Copy the main template (perhaps with site tweaks) to seed
           
  -        # :TODO: This gave an ugly tree (src/doc/cont../xdocs..)
  -        # with sub-directories. It is a nice idea, but not
  -        # quite there for us now, do a plain old template
  -        # copy instead.
  -        
  -        # First .. seed the project    
  -        #forrestSeed=Cmd('forrest','forrest_seed',forrest)
  -        #forrestSeed.addPrefixedParameter('-D','java.awt.headless','true','=')
  -        #forrestSeed.addParameter('seed')    
  -        #forrestSeedResult=execute(forrestSeed)
  -        # Consider adding, but a second seed might fail, need to ignore that...
  -        #work=CommandWorkItem(WORK_TYPE_DOCUMENT,forrest,forrestSeedResult)
  -        #workspace.performedWork(work)
  -        
  -        # Consider syncDirectories (to start with)
  -        # cp -Rf doesn't seem to be doing a nice job of overwritting :(
  -        # rsynch would disallow default/site though :(
  +        """        
           
           # Copy in the defaults        
  -        forrestTemplate=self.getForrestTemplateDirectory()   
  -        
  -        forrestSeed=Cmd('cp','forrest_seed',forrestParentDir)
  -        forrestSeed.addParameter('-Rfv')
  -        forrestSeed.addParameter(forrestTemplate)    
  -        forrestSeed.addParameter(os.path.abspath(workspace.getBaseDirectory()))    
  -        forrestSeedResult=execute(forrestSeed)
  -        work=CommandWorkItem(WORK_TYPE_DOCUMENT,forrestSeed,forrestSeedResult)
  -        workspace.performedWork(work)
  -        
  +        forrestTemplate=self.getForrestTemplateDirectory()           
  +        syncDirectories(	forrestTemplate,	\
  +                            self.getForrestDirectory(workspace),	\
  +                            workspace)    
  +                                    
           # Copy over the local site defaults (if any)        
           forrestSiteTemplate=self.getForrestSiteTemplateDirectory()  
           if os.path.exists(forrestSiteTemplate):
  -            forrestSiteSeed=Cmd('cp','forrest_site_seed',forrestParentDir)
  -            forrestSiteSeed.addParameter('-Rfv')
  -            forrestSiteSeed.addParameter(forrestSiteTemplate)    
  -            forrestSiteSeed.addParameter(workspace.getBaseDirectory())  
  -            forrestSiteSeedResult=execute(forrestSiteSeed)
  -            work=CommandWorkItem(WORK_TYPE_DOCUMENT,forrestSiteSeed,forrestSiteSeedResult)
  -            workspace.performedWork(work)
  -             
  +            copyDirectories(forrestSiteTemplate,	\
  +                            self.getForrestDirectory(workspace),	\
  +                            workspace)               
            
       def executeForrest(self,workspace):
           # The project tree
  @@ -1119,31 +1095,33 @@
           
           self.documentServerLinks(document,project,workspace)        
               
  +        # Project Details (main ones)
           detailsSection=document.createSection('Details')
  -        
           detailsList=detailsSection.createList()
               
  -        self.insertLink(project.getModule(),project,detailsList.createEntry('Containing Module: '))        
  +        self.insertLink(project.getModule(),project,	\
  +                detailsList.createEntry('Containing Module: '))        
           
  -        if project.hasHomeDirectory():
  +        if project.hasHomeDirectory() and project.isVerboseOrDebug():
               detailsList.createEntry('Home Directory: ', project.getHomeDirectory())
               
  -        if project.hasBaseDirectory():
  +        if project.hasBaseDirectory() and project.isVerboseOrDebug():
               detailsList.createEntry('Base Directory: ', project.getBaseDirectory())
               
           if project.hasCause() and not project==project.getCause():
               self.insertTypedLink(project.getCause(),project,detailsList.createEntry('Root Cause: '))
               
           e = secsToElapsedString(project.getElapsedSecs())
  -        if e: detailsList.createEntry("Elapsed: ", e)
  +        if e and project.isVerboseOrDebug(): detailsList.createEntry("Elapsed: ", e)
                                                         
           # Display nag information
           if project.xml.nag:
  -            for nagEntry in project.xml.nag:
  -                toaddr=getattr(nagEntry,'to') or workspace.mailinglist
  -                fromaddr=getStringFromUnicode(getattr(nagEntry,'from') or workspace.email)
  -                detailsList.createEntry('Nag To: ').createFork('mailto:'+toaddr,toaddr)
  -                detailsList.createEntry('Nag From: ').createFork('mailto:'+fromaddr,fromaddr)
  +            if project.isVerboseOrDebug():
  +                for nagEntry in project.xml.nag:
  +                    toaddr=getattr(nagEntry,'to') or workspace.mailinglist
  +                    fromaddr=getStringFromUnicode(getattr(nagEntry,'from') or workspace.email)
  +                    detailsList.createEntry('Nag To: ').createFork('mailto:'+toaddr,toaddr)
  +                    detailsList.createEntry('Nag From: ').createFork('mailto:'+fromaddr,fromaddr)
           elif not project.isPackaged() and project.hasBuildCommand():            
               document.createWarning('This project does not utilize Gump nagging.')  
                                
  @@ -1185,8 +1163,7 @@
           addnSection=document.createSection('Additional Details')
           addnPara=addnSection.createParagraph()
           addnPara.createLink(gumpSafeName(project.getName()) + '_details.html',	\
  -                            'More project details ...')
  -                                                                            
  +                            'More project details ...')                                                                         
           document.serialize()
           
           document=XDocDocument('Project Details : ' + project.getName(),	\
  @@ -1235,10 +1212,10 @@
           depees = 0
           
           depens += self.documentDependenciesList(dependencySection, "Project Dependencies",	\
  -                    project.getDependencies(), 0, project)
  +                    project.getDirectDependencies(), 0, project)
                       
           depees += self.documentDependenciesList(dependencySection, "Project Dependees",		\
  -                    project.getDependees(), 1, project)
  +                    project.getDirectDependees(), 1, project)
                       
           depens += self.documentDependenciesList(dependencySection, "Full Project Dependencies",	\
                       project.getFullDependencies(), 0, project)
  @@ -1318,7 +1295,7 @@
                   
           if dependencies:
               dependencySection=xdocNode.createSection(title)
  -            dependencyTable=dependencySection.createTable(['Name','Type','Inheritence','Ids','State','Notes'])
  +            dependencyTable=dependencySection.createTable(['Name','Type','Inheritence','Ids','State','Contributor','Notes'])
               for depend in dependencies:
                   
                   totalDeps += 1
  @@ -1352,6 +1329,13 @@
                   # State Icon
                   self.insertStateIcon(project,referencingObject,dependencyRow.createData())
                   
  +                # Contributor
  +                if not dependees:
  +                    contributor=depend.getOwnerProject()
  +                else:
  +                    contributor=depend.getProject()
  +                self.insertLink( contributor, referencingObject, dependencyRow.createData())      
  +                
                   # Dependency Annotations
                   noteData=dependencyRow.createData()
                   if depend.getAnnotations():
  @@ -1409,22 +1393,18 @@
                   if results:
                       statePair=results.getStatePair()
                                   
  -            # If we can resolve this object to a URL, then do
  -            dataNode=serverRow.createData()
  -            xdocNode=None
  -                        
  +            # If we can resolve this object to a URL, then do                        
               if server.hasResolver():
  +                dataNode=serverRow.createData()    
  +            
                   xdocNode=dataNode.createFork(	\
                           server.getResolver().getUrl(linkable))
  -            else:
  -                # Else just link to the server.
  -                if server.hasUrl():
  -                    xdocNode=dataNode.createFork(	\
  -                            server.getUrl())  
               
  -            if xdocNode:
                   xdocNode.createText('On ' + server.getName())
  +                
                   if statePair:
  +                    xdocNode.createBreak()
  +                    # Insert the Icon...
                       depth=getDepthForObject(linkable)
                       self.insertStatePairIconAtDepth(dataNode,statePair,depth)                
                   
  
  
  
  1.11      +5 -5      gump/python/gump/document/text.py
  
  Index: text.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/document/text.py,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- text.py	8 Mar 2004 22:28:09 -0000	1.10
  +++ text.py	9 Mar 2004 19:57:06 -0000	1.11
  @@ -132,10 +132,10 @@
           
           
           self.documentDependenciesList(indent, "Project Dependees",		\
  -                project.getDependees(), 1, project)
  +                project.getDirectDependees(), 1, project)
               
           self.documentDependenciesList(indent, "Project Dependencies",	\
  -                project.getDependencies(), 0, project)
  +                project.getDirectDependencies(), 0, project)
           
           self.documentAnnotations(indent,project)
           self.documentWork(indent,project)
  
  
  
  1.1                  gump/python/profileView.py
  
  Index: profileView.py
  ===================================================================
  import pstats
  p = pstats.Stats('iprof')
  
  p.sort_stats('cumulative').print_stats()
  
  
  
  
  
  1.11      +3 -3      gump/python/gump/gumprun.py
  
  Index: gumprun.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/gumprun.py,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- gumprun.py	8 Mar 2004 22:28:08 -0000	1.10
  +++ gumprun.py	9 Mar 2004 19:57:06 -0000	1.11
  @@ -279,7 +279,7 @@
       # on the todo list.
       #
       def isReady(self,project,todo):
  -        for dependency in project.getDependencies():
  +        for dependency in project.getDirectDependencies():
               if dependency.getProject() in todo: return 0
           return 1
   
  @@ -289,7 +289,7 @@
           if not project in todo:
               todo.append(project)
               
  -        for dependency in project.getDependencies():
  +        for dependency in project.getDirectDependencies():
               # Add all dependencies
               dependProject=dependency.getProject()
               if not dependProject in todo: 
  @@ -298,7 +298,7 @@
       # determine if this project is a prereq of any project on the todo list
       def isPrereq(self,project,todo):
           for todoProject in todo:
  -            for dependency in todoProject.getDependencies():
  +            for dependency in todoProject.getDirectDependencies():
                   if dependency.getProject().getName()==project.getName(): return 1
   
       def dump(self, indent=0, output=sys.stdout):
  
  
  
  1.78      +7 -18     gump/python/gump/engine.py
  
  Index: engine.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/engine.py,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- engine.py	9 Mar 2004 00:20:51 -0000	1.77
  +++ engine.py	9 Mar 2004 19:57:06 -0000	1.78
  @@ -371,27 +371,16 @@
       
               if module.okToPerformWork():
               
  -                sourcedir = os.path.abspath(os.path.join(workspace.getCvsDirectory(),module.name)) # todo allow override
  +                sourcedir = os.path.abspath(os.path.join(workspace.getCvsDirectory(), \
  +                                        module.name)) # todo allow override
                   destdir = os.path.abspath(workspace.getBaseDirectory())
  -        
  -        
  -                # 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:
  -                    module.changeState(STATE_FAILED,REASON_SYNC_FAILED)
  -                else:
  +                # Perform the sync...
  +                try:
  +                    syncDirectories(sourcedir,destdir,module)
                       module.changeState(STATE_SUCCESS)
  +                except:
  +                    module.changeState(STATE_FAILED,REASON_SYNC_FAILED)
                   
       """
       
  
  
  
  1.22      +13 -8     gump/python/gump/integrate.py
  
  Index: integrate.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/integrate.py,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- integrate.py	8 Mar 2004 22:28:08 -0000	1.21
  +++ integrate.py	9 Mar 2004 19:57:06 -0000	1.22
  @@ -90,14 +90,12 @@
   # Initialize
   ###############################################################################
   
  -
   ###############################################################################
   # Functions
   ###############################################################################
   
  -# static void main()
  -if __name__=='__main__':
  -
  +def irun():
  +    
       # Process command line
       (args,options) = handleArgv(sys.argv)
       ws=args[0]
  @@ -127,4 +125,11 @@
       log.info('Gump Integration complete. Exit code:' + str(result))                  
             
       # bye!
  -    sys.exit(result)
  \ No newline at end of file
  +    sys.exit(result)
  +    
  +# static void main()
  +if __name__=='__main__':
  +    #print 'Profiling....'
  +    #import profile
  +    #profile.run('irun()', 'iprof')
  +    irun()
  
  
  
  1.6       +2 -2      gump/python/gump/gui/view.py
  
  Index: view.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/gui/view.py,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- view.py	8 Mar 2004 22:28:09 -0000	1.5
  +++ view.py	9 Mar 2004 19:57:07 -0000	1.6
  @@ -352,7 +352,7 @@
   
       # gather a list of projects which reference this project
       self.items=[]
  -    for dependency in project.getDependees():
  +    for dependency in project.getDirectDependees():
           self.items.append(dependency.getOwnerProject().getName())
   
       # display the list, sorted by name
  @@ -403,7 +403,7 @@
         self.prereqs.InsertColumn(0, 'Prerequisites')
   
       i=0
  -    for dependency in project.getDependencies():
  +    for dependency in project.getDirectDependencies():
         prereq=dependency.getProject()
         #if prereq.ant or prereq.script: continue
         row=self.prereqs.InsertStringItem(i,prereq.getName())
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org