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/07/13 20:44:36 UTC

cvs commit: gump/python/gump/test/resources/full1 server3.xml server2.xml

ajack       2004/07/13 11:44:36

  Modified:    python/gump/timing keeper.py
               python/gump/runner runner.py demand.py
               python/gump/admin __init__.py stats.py
               python/gump/notify notification.py logic.py notifier.py
               python/gump/core commandLine.py actor.py config.py
                        gumprun.py gumpinit.py gumpenv.py
               python/gump/document/xdocs resolver.py xdoc.py documenter.py
               python/gump/model workspace.py
               python/gump/build script.py ant.py abstract.py
               python/gump/test/resources/full1 server3.xml server2.xml
  Log:
  Various clean-ups & optimizations (i.e. reducing documentation)
  [try #2 due to socket failure]
  
  Revision  Changes    Path
  1.3       +16 -8     gump/python/gump/timing/keeper.py
  
  Index: keeper.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/timing/keeper.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- keeper.py	21 May 2004 23:15:04 -0000	1.2
  +++ keeper.py	13 Jul 2004 18:44:35 -0000	1.3
  @@ -17,17 +17,25 @@
       Times
   """
   
  -from gump.core.gumprun import *
  -from gump.core.actor import AbstractRunActor
  +import gump.core.gumprun
  +import gump.core.actor
   
  -class TimeKeeper(AbstractRunActor):
  +class TimeKeeper(gump.core.actor.AbstractRunActor):
       
  -    def __init__(self,run):              
  -        AbstractRunActor.__init__(self,run)              
  +    def __init__(self,run):          
  +        """
  +        The TimeKeeper extracts elapsed time information.    
  +        """
  +        gump.core.actor.AbstractRunActor.__init__(self,run)              
           
  -    def processOtherEvent(self,event):            
  -        if isinstance(event,InitializeRunEvent):
  +    def processOtherEvent(self,event):      
  +        """
  +        	Process non-Entity based events, i.e.
  +        	timstamp the start and end of the
  +        	run.      
  +        """
  +        if isinstance(event,gump.core.gumprun.InitializeRunEvent):
               self.run.getWorkspace().setStartTime()
  -        elif isinstance(event,FinalizeRunEvent):  
  +        elif isinstance(event,gump.core.gumprun.FinalizeRunEvent):  
               self.run.getWorkspace().setEndTime()
               
  
  
  
  1.9       +12 -12    gump/python/gump/runner/runner.py
  
  Index: runner.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/runner/runner.py,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- runner.py	12 Jul 2004 18:24:27 -0000	1.8
  +++ runner.py	13 Jul 2004 18:44:35 -0000	1.9
  @@ -58,22 +58,16 @@
           
           logResourceUtilization('Before initialize')
           
  -        #
           # Perform start-up logic 
  -        #
           workspace = self.run.getWorkspace()
                   
  -        #
  -        #
  -        #
  +        #Check out environment
           if not self.run.getOptions().isQuick():
               logResourceUtilization('Before check environment')            
               self.run.getEnvironment().checkEnvironment(exitOnError)
               logResourceUtilization('After check environment')
           
  -        #
           # Modify the log location on the fly, if --dated
  -        #
           if self.run.getOptions().isDated():
               workspace.setDatedDirectories()     
                       
  @@ -101,9 +95,14 @@
           self.initializeActors()             
    
           # Let's get going...
  -        self.run.dispatchEvent(InitializeRunEvent(self.run))
  +        self.run._dispatchEvent(InitializeRunEvent(self.run))
       
       def initializeActors(self):
  +        """
  +        
  +        Install the appropriate actors..
  +        
  +        """
           
           # Stamp times
           self.run.registerActor(TimeKeeper(self.run))
  @@ -111,13 +110,14 @@
           # Update statistics
           self.run.registerActor(Statistician(self.run))
           
  -        # Generate results
  -        if self.run.getOptions().isResults():
  +        # Load/Generate results (if we are in a multi-server)
  +        # environment, where result sharing is important
  +        if self.run.getOptions().isResults() and \
  +            self.run.getWorkspace().hasMultiplePythonServers():
               self.run.registerActor(Resulter(self.run))            
                 
           # Document..
           # Use XDOCS if not overridden...
  -        #
           documenter=None
           if self.run.getOptions().isText() :
               documenter=TextDocumenter(self.run)
  @@ -138,7 +138,7 @@
                       
       def finalize(self):            
           # About to shutdown...
  -        self.run.dispatchEvent(FinalizeRunEvent(self.run))
  +        self.run._dispatchEvent(FinalizeRunEvent(self.run))
           
       def getUpdater(self):
           return self.updater
  
  
  
  1.8       +5 -1      gump/python/gump/runner/demand.py
  
  Index: demand.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/runner/demand.py,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- demand.py	12 Jul 2004 18:24:27 -0000	1.7
  +++ demand.py	13 Jul 2004 18:44:35 -0000	1.8
  @@ -134,15 +134,19 @@
           gumpOptions=self.run.getOptions() 
           workspace = self.run.getWorkspace()
           
  +        # If we want to do updates
           if gumpOptions.isUpdate():
  +            # If we want multithreaded (and workspace allows)
               if workspace.isMultithreading() and workspace.hasUpdaters():
  -                # Experimental...
  +                # Experimental: Spawn some...
                   self.spawnUpdateThreads(workspace.getUpdaters())
           
           # The project TODO list...
           if gumpOptions.isQuick():
  +            # Just the projects
               sequence=gumpSet.getProjects()
           else:
  +            # The full build sequence
               sequence=gumpSet.getProjectSequence()
           
           # In order...
  
  
  
  1.2       +2 -2      gump/python/gump/admin/__init__.py
  
  Index: __init__.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/admin/__init__.py,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- __init__.py	16 Apr 2004 17:28:42 -0000	1.1
  +++ __init__.py	13 Jul 2004 18:44:35 -0000	1.2
  @@ -20,7 +20,7 @@
   
   """
   
  -  Gump Core Entry Points.
  +  Gump Admin entry points.
     
   """
   
  
  
  
  1.3       +1 -1      gump/python/gump/admin/stats.py
  
  Index: stats.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/admin/stats.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- stats.py	8 Jul 2004 20:33:10 -0000	1.2
  +++ stats.py	13 Jul 2004 18:44:35 -0000	1.3
  @@ -17,7 +17,7 @@
   
   """
   
  -    Statistics manipulation [e.g. reseting, etc.]
  +    A tool for statistics manipulation [e.g. reseting, etc.]
       
   """
   
  
  
  
  1.3       +1 -1      gump/python/gump/notify/notification.py
  
  Index: notification.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/notify/notification.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- notification.py	8 Jul 2004 20:33:06 -0000	1.2
  +++ notification.py	13 Jul 2004 18:44:35 -0000	1.3
  @@ -15,7 +15,7 @@
   
   """
   
  -    'Nag' (notification) e-mail generation...
  +    A 'Nag' (notification) content.
       
   """
   
  
  
  
  1.5       +5 -3      gump/python/gump/notify/logic.py
  
  Index: logic.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/notify/logic.py,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- logic.py	12 Jul 2004 15:18:04 -0000	1.4
  +++ logic.py	13 Jul 2004 18:44:35 -0000	1.5
  @@ -14,7 +14,11 @@
   # limitations under the License.
   
   """
  -    'Nag' (notification) e-mail generation...
  +
  +    The logic for 'Nag' (notification) e-mail generation, i.e. do it
  +    when official or when first changes state (failed to success or
  +    succes to failed).
  +    
   """
   
   import socket
  @@ -22,8 +26,6 @@
   import os
   import sys
   import logging
  -
  -from string import lower, capitalize
   
   from gump import log
   from gump.core.config import *
  
  
  
  1.9       +3 -1      gump/python/gump/notify/notifier.py
  
  Index: notifier.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/notify/notifier.py,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- notifier.py	12 Jul 2004 15:54:17 -0000	1.8
  +++ notifier.py	13 Jul 2004 18:44:35 -0000	1.9
  @@ -14,7 +14,9 @@
   # limitations under the License.
   
   """
  -    'Nag' (notification) e-mail generation...
  +
  +    The 'Nag' (notification) e-mail generation Actor...
  +    
   """
   
   import socket
  
  
  
  1.12      +4 -1      gump/python/gump/core/commandLine.py
  
  Index: commandLine.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/core/commandLine.py,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- commandLine.py	12 Jul 2004 15:18:04 -0000	1.11
  +++ commandLine.py	13 Jul 2004 18:44:35 -0000	1.12
  @@ -16,7 +16,10 @@
   
   """
   
  -    Commandline Handling
  +    Commandline Handling.
  +    
  +    Note: All gump scripts currently have the same command line
  +    
       
   """
   import sys
  
  
  
  1.4       +2 -2      gump/python/gump/core/actor.py
  
  Index: actor.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/core/actor.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- actor.py	8 Jul 2004 20:33:09 -0000	1.3
  +++ actor.py	13 Jul 2004 18:44:35 -0000	1.4
  @@ -24,8 +24,8 @@
   	Example actors are:
   	
   		Statistician (keeps track of statistics, in a DB)
  -		
  - 
  +		TimeKeeper (keeps track of time spent on various things)
  +		Documenter (writes HTML for the work)
   """
   
   import os.path
  
  
  
  1.8       +2 -0      gump/python/gump/core/config.py
  
  Index: config.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/core/config.py,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- config.py	12 Jul 2004 15:54:17 -0000	1.7
  +++ config.py	13 Jul 2004 18:44:35 -0000	1.8
  @@ -76,6 +76,8 @@
       signature="\r\n--\r\nApache Gump\nhttp://gump.apache.org/ " \
           + '[Instance: ' + gumpfullhost + "]\n"
           
  +        
  +    # Information for portability
       if not os.name == 'dos' and not os.name == 'nt':
           classpathSeparator=':'
           shellQuote='\''
  
  
  
  1.12      +123 -67   gump/python/gump/core/gumprun.py
  
  Index: gumprun.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/core/gumprun.py,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- gumprun.py	12 Jul 2004 15:18:04 -0000	1.11
  +++ gumprun.py	13 Jul 2004 18:44:35 -0000	1.12
  @@ -24,16 +24,15 @@
   import os.path
   import os
   import sys
  -from fnmatch import fnmatch
  +import fnmatch
   
   from gump import log
   from gump.core.config import dir, default, basicConfig
   from gump.core.gumpenv import GumpEnvironment
   
  -
  -from gump.utils.work import *
  -from gump.utils import dump, display, getIndent
  -from gump.utils.note import Annotatable
  +import gump.utils
  +import gump.utils.work
  +import gump.utils.note
   
   from gump.model.workspace import Workspace
   from gump.model.module import Module
  @@ -52,8 +51,25 @@
   ###############################################################################
   
   class GumpSet:
  -    """ Contains the primary works sets -- to save recalculating and
  -    passing so many individual things around """
  +    """ 
  +    
  +    Contains the primary works sets -- to save recalculating and
  +    passing so many individual things around.
  +    
  +    First, a project expression (list of * or all or wildcarded) is matched 
  +    against the projects in the workspace, and a like of projects is found.
  +    That list of projects is expanded to includes all their dependencies, in
  +    build order, and this is store as the projectSequence.
  +    
  +    Second, the project list and projectSequence are converted to the same,
  +    but for modules. 
  +    
  +    As such the gumpset identifies what work needs to be done.
  +    
  +    Additionally there are list of what entities have been completed (e.g.
  +    modules updated, projects built).
  +    
  +    """
       def __init__(self, workspace, pexpr=None, \
                           projects=None, projectSequence=None, \
                           modules=None, moduleSequence=None, \
  @@ -66,41 +82,31 @@
           if not pexpr:
               self.projectexpression='*'
           
  -        #
           # Requested Projects
  -        #
           if not projects:
               self.projects=self.getProjectsForProjectExpression(pexpr)
           else:
               self.projects=projects
           
  -        #
           # Project Build Sequence
  -        #
           if not projectSequence:
               self.projectSequence=self.getBuildSequenceForProjects(self.projects)
           else:
               self.projectSequence=projectSequence
               
  -        #
           # Module List
  -        #
           if not modules:
               self.modules=self.getModulesForProjectList(self.projects)
           else:
               self.modules=modules 
           
  -        #
           # Module Sequence
  -        #
           if not moduleSequence:
               self.moduleSequence=self.getModulesForProjectList(self.projectSequence)
           else:
               self.moduleSequence=moduleSequence
           
  -        #
           # Repository List
  -        #
           if not repositories:
               self.repositories=self.getRepositoriesForModuleList(self.moduleSequence)
           else:
  @@ -168,22 +174,40 @@
           return self.projects
                 
       def inProjects(self,project):
  +        """
  +        Is this project one of the requested projects?
  +        """
           return project in self.projects
         
       def getProjectExpression(self):
  +        """
  +        Return the user provided project list/expression
  +        """
           return self.projectexpression
           
       def getCompletedProjects(self):
  +        """
  +        The projects completed so far
  +        """
           return self.completedProjects
           
       def setCompletedProject(self,project):
  +        """
  +        This project has become completed.
  +        """
           self.completedProjects.append(project)
           
       def getProjectSequence(self):
  +        """
  +        The full (with dependencies) project sequence
  +        """
           return self.projectSequence    
   
       def inProjectSequence(self,project):
  -        # Optimization
  +        """
  +        Is this project within the main seuqence?
  +        """
  +        # Optimization ('all' means, of course...)
           if self.isFull(): return True    
           # Go look...
           return project in self.projectSequence
  @@ -257,7 +281,7 @@
                   for pattern in expr.split(','):
                       try:
                           if pattern=="all": pattern='*'
  -                        if fnmatch(project.getName(),pattern): break                    
  +                        if fnmatch.fnmatch(project.getName(),pattern): break                    
                       except Exception, detail:
                           log.error('Failed to regexp: ' + pattern + '. Details: ' + str(detail))
                           continue
  @@ -357,7 +381,7 @@
   
       def dump(self, indent=0, output=sys.stdout):
           """ Display the contents of this object """
  -        i=getIndent(indent)
  +        i=gump.utils.getIndent(indent)
           output.write(i+'Expression: ' + self.getProjectExpression() + '\n')   
           
           self.dumpList(self.projects,'Projects :',indent+1,output)
  @@ -368,7 +392,7 @@
               
       def dumpList(self,list,title,indent=0,output=sys.stdout):
           """ Display a single list """  
  -        i=getIndent(indent)              
  +        i=gump.utils.getIndent(indent)              
           output.write(SEPARATOR)          
           output.write('\n')
           output.write(i + title + '[' + str(len(list)) + '] : \n') 
  @@ -489,22 +513,10 @@
       def setObjectives(self,objectives):
           self.objectives=objectives
           
  -    def testObjectiveIsSet(self,objective):
  +    def _testObjectiveIsSet(self,objective):
           if (self.objectives & objective): return True
           return False
           
  -    def isUpdate(self):
  -        return self.testObjectiveIsSet(OBJECTIVE_UPDATE)        
  -        
  -    def isBuild(self):
  -        return self.testObjectiveIsSet(OBJECTIVE_BUILD)
  -              
  -    def isCheck(self):
  -        return self.testObjectiveIsSet(OBJECTIVE_CHECK)
  -        
  -    def isDocument(self):
  -        return self.testObjectiveIsSet(OBJECTIVE_DOCUMENT)
  -        
       # Features...
       def setFeatures(self,features):
           self.features=features
  @@ -515,33 +527,75 @@
       def enableFeature(self,feature):
           self.features = (self.features | feature)
           
  -    def testFeatureIsSet(self,feature):
  +    def _testFeatureIsSet(self,feature):
  +        """
  +        A utility method to see if a feature is set.
  +        """
           if (self.features & feature): return True
           return False
  +        
  +    def isUpdate(self):
  +        """
  +        Are Updates (CVS|SVN|...) to be performed?
  +        """
  +        return self._testObjectiveIsSet(OBJECTIVE_UPDATE)        
  +        
  +    def isBuild(self):
  +        """
  +        Are Builds (Ant|...) to be performed?
  +        """
  +        return self._testObjectiveIsSet(OBJECTIVE_BUILD)
  +              
  +    def isCheck(self): 
  +        """
  +        Is this really jsut a 'check' or things?
  +        """
  +        return self._testObjectiveIsSet(OBJECTIVE_CHECK) 
   
       def isNotify(self):
  -        return self.testFeatureIsSet(FEATURE_NOTIFY)
  +        """
  +        Are notifications (nag e-mails) to be produced?
  +        """
  +        return self._testFeatureIsSet(FEATURE_NOTIFY)
   
       def isResults(self):
  -        return self.testFeatureIsSet(FEATURE_RESULTS)
  +        """
  +        Are results to be downloaded/produced for this run?
  +        """
  +        return self._testFeatureIsSet(FEATURE_RESULTS)
   
       def isStatistics(self):
  -        return self.testFeatureIsSet(FEATURE_STATISTICS)
  +        return self._testFeatureIsSet(FEATURE_STATISTICS)
   
       def isDocument(self):
  -        return self.testFeatureIsSet(FEATURE_DOCUMENT)
  +        """
  +        Is documentation to be created for this run?
  +        """
  +        
  +    def isDocument(self):
  +        return  self._testObjectiveIsSet(OBJECTIVE_DOCUMENT) and \
  +                self._testFeatureIsSet(FEATURE_DOCUMENT)
   
       def isSyndicate(self):
  -        return self.testFeatureIsSet(FEATURE_SYNDICATE)
  +        """
  +        Is syndication (RSS|Atom) to be performed for this run?
  +        """
  +        return self._testFeatureIsSet(FEATURE_SYNDICATE)
   
       def isDiagram(self):
  -        return self.testFeatureIsSet(FEATURE_DIAGRAM)
  +        """
  +        Are SVG dependency diagrams to be generated for this run?
  +        """
  +        return self._testFeatureIsSet(FEATURE_DIAGRAM)
   
           
   class RunSpecific:
       """
  -    
  -        A class that is it specific to an instance of a run
  +        A class that is it specific to an instance of a run.
  +        
  +        A run is so central to Gump that it is like a thread,
  +        the basis for everything, so many things are specific
  +        to a single run (for conveinience).
           
       """
       def __init__(self, run):
  @@ -551,7 +605,6 @@
           return self.run
   
   
  -
   class RunEvent(RunSpecific):
       """
           An event to actors (e.g. a project built, a module updated)
  @@ -563,8 +616,17 @@
       def __repr__(self):
           return self.__class__.__name__
           
  -class InitializeRunEvent(RunEvent): pass
  -class FinalizeRunEvent(RunEvent): pass
  +class InitializeRunEvent(RunEvent): 
  +    """
  +    	The run is starting...
  +    """
  +    pass
  +    
  +class FinalizeRunEvent(RunEvent): 
  +    """
  +        The run is completed...
  +    """
  +    pass
           
   class EntityRunEvent(RunEvent):
       """
  @@ -591,6 +653,8 @@
                   
   class RunRequest(RunEvent):
       """
  +    
  +    	A request for some work (not used yet)
   
       """            
       def __init__(self, run, type):
  @@ -606,9 +670,11 @@
           
   class EntityRunRequest(RunEvent):
       """
  -
  +    
  +		An request regarding a known entity (e.g. Workspace/Module/Project).
  +		(not used yet)
  +		
       """
  -            
       def __init__(self, run, type, entity):
           RunEvent.__init__(self, run, type)
           
  @@ -620,42 +686,32 @@
       def getEntity(self):
           return self.entity 
                   
  -class GumpRun(Workable,Annotatable,Stateful):
  +class GumpRun(gump.utils.work.Workable,gump.utils.note.Annotatable,Stateful):
       def __init__(self,workspace,expr=None,options=None,env=None):
           
  -        Workable.__init__(self)
  -        Annotatable.__init__(self)
  +        gump.utils.work.Workable.__init__(self)
  +        gump.utils.note.Annotatable.__init__(self)
           Stateful.__init__(self)
           
  -        #
           # The workspace being worked upon
  -        #
           self.workspace=workspace
           
  -        #
           # The set of modules/projects/repos in use
  -        #
           self.gumpSet=GumpSet(self.workspace,expr)
           
  -        #
           # The run options
  -        #
           if options:
               self.options=options
           else:
               self.options=GumpRunOptions()
           
  -        #
  -        # The run options
  -        #
  +        # The environment
           if env:
               self.env=env
           else:
               self.env=GumpEnvironment()
           
  -        #
           # A repository interface...
  -        #
           from gump.repository.artifact import ArtifactRepository
           self.outputsRepository=ArtifactRepository(workspace.jardir)
                     
  @@ -698,7 +754,7 @@
       def dump(self, indent=0, output=sys.stdout):
           """ Display the contents of this object """
           
  -        i=getIndent(indent)
  +        i=gump.utils.getIndent(indent)
           #output.write(i+'Expression: ' + self.gumpSet. + '\n')
           output.write(i+'Gump Set:\n')
           self.gumpSet.dump(indent+1,output)
  @@ -707,7 +763,7 @@
           log.debug('Register Actor : ' + `actor`)
           self.actors.append(actor)
           
  -    def dispatchEvent(self,event):    	
  +    def _dispatchEvent(self,event):    	
       	"""
       		Perform the dispatch
       	"""
  @@ -717,7 +773,7 @@
               actor._processEvent(event)
           inspectGarbageCollection(`event`)
               
  -    def dispatchRequest(self,request):
  +    def _dispatchRequest(self,request):
       	"""
       		Perform the dispatch
       	"""
  @@ -731,10 +787,10 @@
           """
       		Fire off an entity event.
       	"""
  -        self.dispatchEvent(EntityRunEvent(self, entity))
  +        self._dispatchEvent(EntityRunEvent(self, entity))
           
       def generateRequest(self,type):
       	"""
       		Fire off a typed request.
       	"""
  -        self.dispatchRequest(RunRequest(self, type))
  \ No newline at end of file
  +        self._dispatchRequest(RunRequest(self, type))
  \ No newline at end of file
  
  
  
  1.5       +5 -2      gump/python/gump/core/gumpinit.py
  
  Index: gumpinit.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/core/gumpinit.py,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- gumpinit.py	8 Jul 2004 20:33:09 -0000	1.4
  +++ gumpinit.py	13 Jul 2004 18:44:35 -0000	1.5
  @@ -19,7 +19,9 @@
   # 
   
   """
  +
     Gump Entry Points.
  +  
   """
   
   import os.path
  @@ -47,13 +49,14 @@
       # Initialize GC (sometimes w/ debug)
       initializeGarbageCollection()
       
  -    #
  +    # If a .timestamp exists, use it.
       timestamp=os.path.join(dir.base,'.timestamp')
       if os.path.exists(timestamp):
           default.time = os.path.getmtime(timestamp)
       else:
           default.time = time.time()
   
  +    # Generate for local and date...
       default.ltime=time.localtime(default.time)
       default.date = time.strftime('%Y%m%d',default.ltime)
       default.datetime = time.strftime('%Y%m%d %H:%M:%S',default.ltime)
  
  
  
  1.8       +29 -20    gump/python/gump/core/gumpenv.py
  
  Index: gumpenv.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/core/gumpenv.py,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- gumpenv.py	8 Jul 2004 20:33:09 -0000	1.7
  +++ gumpenv.py	13 Jul 2004 18:44:35 -0000	1.8
  @@ -17,7 +17,8 @@
   
   """
   
  - A gump environment
  + A gump environment (i.e. what tools are available in this machines
  + environment, and so forth).
    
   """
   
  @@ -48,6 +49,13 @@
   TZ='%+.2d:00' % (-time.timezone/3600)
   
   class GumpEnvironment(Annotatable,Workable,Propogatable):
  +    """
  +    	Represents the environment that Gump is running within.
  +    	
  +    	What environment variables are set, what tools are 
  +    	available, what Java command to use, etc.
  +    	
  +    """
   
       def __init__(self):
           Annotatable.__init__(self)
  @@ -80,13 +88,13 @@
           # DEPOT_HOME
           self.depotHome = None
           
  -        #
           # Offset from UTC
  -        #
           self.timezoneOffset=TZ
           
       def checkEnvironment(self,exitOnError=False):
  -        """ Check Things That are Required """
  +        """ 
  +        Check Things That are Required 
  +        """
           
           if self.checked: return
       
  @@ -117,19 +125,19 @@
           #	JAVA_HOME for bootstrap ant?
           #	CLASSPATH
       
  -        if not self.noJavaHome and not self.checkEnvVariable('JAVA_HOME',False):    
  +        if not self.noJavaHome and not self._checkEnvVariable('JAVA_HOME',False):    
               self.noJavaHome=True    
               self.addWarning('JAVA_HOME environmental variable not found. Might not be needed.')
                   
  -        if not self.noClasspath and not self.checkEnvVariable('CLASSPATH',False):
  +        if not self.noClasspath and not self._checkEnvVariable('CLASSPATH',False):
               self.noClasspath=True    
               self.addWarning('CLASSPATH environmental variable not found. Might not be needed.')
                   
  -        if not self.noMaven and not self.checkEnvVariable('MAVEN_HOME',False): 
  +        if not self.noMaven and not self._checkEnvVariable('MAVEN_HOME',False): 
               self.noMaven=True
               self.addWarning('MAVEN_HOME environmental variable not found, no maven builds.')
               
  -        if not self.noDepot and not self.checkEnvVariable('DEPOT_HOME',False): 
  +        if not self.noDepot and not self._checkEnvVariable('DEPOT_HOME',False): 
               self.noDepot=True
               self.addWarning('DEPOT_HOME environmental variable not found, no depot downloads.')
           
  @@ -143,44 +151,44 @@
           #	cvs
           #	svn
           #
  -        self.checkExecutable('env','',False)
  +        self._checkExecutable('env','',False)
   
  -        if not self.noJava and not self.checkExecutable(self.javaCommand,'-version',exitOnError,1):
  +        if not self.noJava and not self._checkExecutable(self.javaCommand,'-version',exitOnError,1):
               self.noJava=True
               self.noJavac=True
   
  -        if not self.noJavac and not self.checkExecutable('javac','-help',False):
  +        if not self.noJavac and not self._checkExecutable('javac','-help',False):
               self.noJavac=True
   
  -        if not self.noJavac and not self.checkExecutable('java com.sun.tools.javac.Main','-help',False,False,'check_java_compiler'):
  +        if not self.noJavac and not self._checkExecutable('java com.sun.tools.javac.Main','-help',False,False,'check_java_compiler'):
               self.noJavac=True
   
  -        if not self.noCvs and not self.checkExecutable('cvs','--version',False):
  +        if not self.noCvs and not self._checkExecutable('cvs','--version',False):
               self.noCvs=True
               self.addWarning('"cvs" command not found, no CVS repository updates')
           
  -        if not self.noSvn and not self.checkExecutable('svn','--version',False):
  +        if not self.noSvn and not self._checkExecutable('svn','--version',False):
               self.noSvn=True
               self.addWarning('"svn" command not found, no SVN repository updates')
           
           if not self.noTimeout:
  -            if	not self.checkExecutable('timeout','60 env',False): 
  +            if	not self._checkExecutable('timeout','60 env',False): 
                   self.noTimeout=True
                   self.addWarning('"timeout" command not found, no in-line command time outs')
               else:
                   setting.timeoutCommand=True
               
           if not self.noUpdate and \
  -            not self.checkExecutable(getDepotUpdateCmd(),'-version',False,False,'check_depot_update'): 
  +            not self._checkExecutable(getDepotUpdateCmd(),'-version',False,False,'check_depot_update'): 
               self.noUpdate=True
               self.addWarning('"update.py" command not found, no package downloads')
           
           if not self.noMaven and \
  -            not self.checkExecutable('maven','--version',False,False,'check_maven'): 
  +            not self._checkExecutable('maven','--version',False,False,'check_maven'): 
               self.noMaven=True
               self.addWarning('"maven" command not found, no Maven builds')
           
  -        if not self.noPGrep and not self.checkExecutable('pgrep','-help',False): 
  +        if not self.noPGrep and not self._checkExecutable('pgrep','-help',False): 
               self.noPGrep=True
               self.addWarning('"pgrep" command not found, no process clean-ups can occur')        
       
  @@ -192,6 +200,7 @@
           if not isinstance(self.javaProperties,NoneType): 
               return self.javaProperties
   
  +        # Ensure we've determined the Java Compiler to use
           self.checkEnvironment()
           
           if self.noJavac: return {}
  @@ -231,7 +240,7 @@
   
           return self.javaProperties
   
  -    def checkExecutable(self,command,options,mandatory,logOutput=False,name=None):
  +    def _checkExecutable(self,command,options,mandatory,logOutput=False,name=None):
           ok=False
           try:
               if not name: name='check_'+command
  @@ -263,7 +272,7 @@
               
           return ok
       
  -    def checkEnvVariable(self,env,mandatory=True):
  +    def _checkEnvVariable(self,env,mandatory=True):
           ok=False
           try:
               ok=os.environ.has_key(env)
  
  
  
  1.5       +3 -1      gump/python/gump/document/xdocs/resolver.py
  
  Index: resolver.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/document/xdocs/resolver.py,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- resolver.py	8 Jul 2004 20:33:09 -0000	1.4
  +++ resolver.py	13 Jul 2004 18:44:36 -0000	1.5
  @@ -15,7 +15,9 @@
   # limitations under the License.
   
   """
  -    Resolving URLs/Files.
  +
  +    Resolving URLs/Files for Gump objects.
  +    
   """
   
   import time
  
  
  
  1.6       +4 -3      gump/python/gump/document/xdocs/xdoc.py
  
  Index: xdoc.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/document/xdocs/xdoc.py,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- xdoc.py	9 Jul 2004 18:25:03 -0000	1.5
  +++ xdoc.py	13 Jul 2004 18:44:36 -0000	1.6
  @@ -246,8 +246,9 @@
       def end(self):
           if not self.config.isXhtml():      
               self.context.writeLineIndented('</section>')
  -        else:
  -            self.context.writeLineIndented('<hr/>')    
  +        # Not pretty.
  +        #else:
  +        #    self.context.writeLineIndented('<hr/>')    
           
       def createParagraph(self,text=None,transient=False):
           return self.storePiece(XDocParagraph(self.createSubContext(transient),self.config,text))
  @@ -779,7 +780,7 @@
               self.context.writeLine('</document>')            
           else:
               from gump.core.config import default
  -            self.context.writeLine('<p align="right">Last Updated: %s.<img align="right" src="%s/images/PythonPowered.gif" alt="Python Logo"/></p>' \
  +            self.context.writeLine('<p align="right">Last Updated: %s.<A TARGET="_new" HREF="http://python.org"><img border ="0" align="right" src="%s/images/PythonPowered.gif" alt="Python Logo"/></A></p>' \
                                       % (default.datetime, self.rootpath)) 
               self.context.writeLine('</html>')            
           self.close()                  
  
  
  
  1.14      +45 -66    gump/python/gump/document/xdocs/documenter.py
  
  Index: documenter.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/document/xdocs/documenter.py,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- documenter.py	12 Jul 2004 18:19:05 -0000	1.13
  +++ documenter.py	13 Jul 2004 18:44:36 -0000	1.14
  @@ -47,8 +47,6 @@
   from gump.model.project import Project
   from gump.model.misc import Resultable
   
  -from gump.notify.logic import NotificationLogic
  -
   from gump.guru.stats import StatisticsGuru
   from gump.guru.xref import XRefGuru
   
  @@ -69,9 +67,6 @@
           resolver=XDocResolver(dirBase,urlBase,self.config)
           self.setResolver(resolver)    
           
  -        # A utility    
  -        self.notifyLogic=NotificationLogic(self.run)
  -        
       def prepareRun(self):
       
           log.debug('--- Prepare for Documenting Results')
  @@ -268,10 +263,13 @@
               
           success=True
           try:
  -            #
  -            # Sync over public pages...
  -            #
  -            syncDirectories(xdocWorkDir,logDirectory)
  +            
  +            if self.run.getOptions().isOfficial():
  +                # Sync over public pages...
  +                syncDirectories(xdocWorkDir,logDirectory)
  +            else:
  +                # Copy over public pages...
  +                copyDirectories(xdocWorkDir,logDirectory)
               
               cleanUp=True       
               if cleanUp:
  @@ -775,9 +773,12 @@
               projects = len(self.gumpSet.getCompletedProjects())
           
               document.createWarning("""This Gump run is currently in progress.
  -            It started at %s. So far %s modules have been updated, and %s projects built.""" \
  -                % (self.workspace.getStartDateTime(), modules, projects ))
  -            
  +            It started at %s. As of this moment (%s), %s modules have been updated, and %s projects built.""" \
  +                % (self.workspace.getStartDateTime(), time.strftime('%H:%M:%S'), modules, projects ))
  +                
  +            document.createNote("""Only projects with significant information 
  +            (e.g a recent change of state, a failure, etc.) are listed at runtime.""")
  +          	
           else:
               document.createNote("""This Gump run is complete. 
               It started at %s and ended at %s.""" 
  @@ -836,7 +837,13 @@
           projectsTable=projectsSection.createTable(['Index','Time','Name','State','Duration\nin state','Last Modified','Notes'])
           pcount=0
           for project in self.gumpSet.getCompletedProjects():
  -            
  +                       
  +            if realTime and \
  +                (project.getState()==STATE_FAILED or \
  +                    ((project.getState()<>STATE_PREREQ_FAILED) and \
  +                     (project.getStats().sequenceInState < INSIGNIFICANT_DURATION))):
  +                continue
  +                
               pcount+=1
       
               projectRow=projectsTable.createRow()            
  @@ -995,9 +1002,8 @@
           projectsSection.createParagraph("""These are the project that need 'fixing'.
   This page helps Gumpmeisters (and others) locate the main areas to focus attention. 
   The count of affected indicates relative importance of fixing this project.""")        
  -        projectsTable=projectsSection.createTable(['Name','Affected',	\
  -                    'Dependees',	\
  -                    'Duration\nin state','Project State'])
  +        projectsTable=projectsSection.createTable(['Name','Affected',
  +                    'Dependees','Project State','Duration\nin state'])
           pcount=0
           
           affectedOrder=createOrderedList(sortedProjectList,compareProjectsByAffected)
  @@ -1018,8 +1024,6 @@
               
               totalAffected += affected
               
  -            # How long been like this
  -            seq=stats=project.getStats().sequenceInState
                       
               projectRow=projectsTable.createRow()
               projectRow.createComment(project.getName())
  @@ -1030,9 +1034,11 @@
               
               projectRow.createData( project.getFullDependeeCount())
               
  -            projectRow.createData(seq)
  -            
               self.insertStateIcon(project,self.workspace,projectRow.createData())
  +            
  +            # How long been like this
  +            seq=stats=project.getStats().sequenceInState 
  +            projectRow.createData(seq)
                   
           if not pcount: 
               projectsTable.createLine('None')    
  @@ -1060,8 +1066,7 @@
           """ % INSIGNIFICANT_DURATION)      
           
           projectsTable=projectsSection.createTable(['Name',	\
  -                    'Dependees',	\
  -                    'Duration\nin state','Project State'])
  +                    'Dependees','Project State','Duration\nin state'])
           pcount=0
           for project in sortedProjectList:
               if not self.gumpSet.inProjectSequence(project): continue       
  @@ -1073,9 +1078,6 @@
                   
               pcount+=1
               
  -            # How long been like this
  -            seq=stats=project.getStats().sequenceInState
  -                    
               projectRow=projectsTable.createRow()
               projectRow.createComment(project.getName())
                                       
  @@ -1083,9 +1085,11 @@
               
               projectRow.createData( project.getFullDependeeCount())
               
  -            projectRow.createData(seq)
  -            
               self.insertStateIcon(project,self.workspace,projectRow.createData())
  +            
  +            # How long been like this
  +            seq=stats=project.getStats().sequenceInState
  +            projectRow.createData(seq)
                   
           if not pcount: 
               projectsTable.createLine('None')   
  @@ -1715,12 +1719,12 @@
                   detailsList.createEntry('Containing Module: '))        
           
           if project.isSpliced():
  -            detailsList.createEntry('XML Spliced: ', `project.isSpliced()`)
  +            detailsList.createEntry('Metadata form from multiple XML pieces: ', `project.isSpliced()`)
               
  -        if project.hasHomeDirectory() and project.isVerboseOrDebug():
  +        if project.hasHomeDirectory():
               detailsList.createEntry('Home Directory: ', project.getHomeDirectory())
               
  -        if project.hasBaseDirectory() and project.isVerboseOrDebug():
  +        if project.hasBaseDirectory():
               detailsList.createEntry('Base Directory: ', project.getBaseDirectory())
               
           if project.hasCause() and not project==project.getCause():
  @@ -1739,10 +1743,6 @@
                   detailsList.createEntry('Notify To: ').createFork('mailto:'+toaddr,toaddr)
                   detailsList.createEntry('Notify From: ').createFork('mailto:'+fromaddr,fromaddr)
                       
  -            if project.isFailed() :            
  -                detailsList.createEntry('Notification E-mail: ').createLink(
  -                                gumpSafeName(project.getName()) + '_notify.html',
  -                                'Contents')   
           elif not project.isPackaged() and project.hasBuildCommand():            
               document.createWarning('This project does not utilize Gump notification.')  
                                
  @@ -1817,7 +1817,7 @@
           #	Outputs (e.g. Jars)
           #
           if project.hasJars():
  -            outputSection = miscSection.createSection('Outputs')
  +            outputSection = miscSection.createSection('Output Artifacts')
               outputTable = outputSection.createTable(['Name','Id'])
               
               for jar in project.getJars():
  @@ -1830,7 +1830,7 @@
                   id=jar.getId() or 'N/A'
                   outputRow.createData(id)    
           else:
  -            miscSection.createWarning('No outputs (e.g. jars) produced')
  +            miscSection.createWarning('No output artifacts (e.g. jars) produced')
           
           if project.hasBuildCommand():
               
  @@ -1882,6 +1882,7 @@
                       True, False, 
                       project)
   
  +        # :TODO: Re-enable?
           if False:
               if project.isVerboseOrDebug():
                   self.documentDependenciesList(dependencySection, 
  @@ -1922,30 +1923,6 @@
           document.serialize()
           document=None
           
  -        # Document notifications
  -        notification = self.notifyLogic.notification(project)
  -        if notification:
  -            nspec=self.resolver.getFileSpec(project,project.getName() + '_notify')    
  -            document=XDocDocument('Project Details : ' + project.getName(),
  -                    nspec.getFile(),
  -                    self.config,
  -                    nspec.getRootPath())
  -                                            
  -            # If they don't ask for it, they won't see it.
  -            part1='could'
  -            part2=', if request in the metadata.'
  -            if project.hasNotifys():
  -                part1='ought'
  -                part2='.'
  -     
  -            nagSection=document.createSection('Notification')
  -            nagSection.createParagraph(('This is the notification mail that %s have been sent%s') \
  -                                            % (part1,part2))
  -            nagSection.createSource(notification.resolveContent(self.resolver))
  -            
  -            document.serialize()
  -            document=None
  -        
           # Document the project XML
       #    x=startXDoc(getProjectXMLDocument(self.workspace,modulename,project.name))
       #    headerXDoc('Project XML')    
  @@ -2114,7 +2091,7 @@
               
       def documentServerLinks(self,xdocNode,linkable,depth=-1):
           
  -        servers=self.workspace.getServers()
  +        servers=self.workspace.getPythonServers()
           if not servers: return    
           if len(servers) == 1: return # Assume this one.     
           
  @@ -2634,7 +2611,9 @@
       #     
       def getFork(self,href,name=None):
           if not name: name = href
  -        return '<fork href=\'%s\'>%s</fork>' % (escape(href),escape(name))
  +        if self.config.isXhtml():
  +            return '<a target="_new" href="%s">%s</a>' % (escape(href),escape(name))
  +        return '<fork href="%s">%s</fork>' % (escape(href),escape(name))
               
       def insertStateDescription(self,toObject,fromObject,xdocNode):
           node=xdocNode.createText(stateDescription(toObject.getState()))
  @@ -3148,9 +3127,9 @@
               fileName='project_depdepth'       
           spec=self.resolver.getFileSpec(stats,fileName)   
           document=XDocDocument(title,    
  -                spec.getFile() ,
  -                self.config,
  -                spec.getRootPath()) 
  +                    spec.getFile() ,
  +                    self.config,
  +                    spec.getRootPath()) 
           durTable=document.createTable(['Project','Dependency Depth','Total Dependency Depth'])
           if total: 
               list = stats.projectsByTotalDependencyDepth
  @@ -3181,7 +3160,7 @@
      
           spec=self.resolver.getFileSpec(xref)
           document=XDocDocument('Cross Reference',self.resolver.getFile(xref),
  -                self.config)
  +                self.config,spec.getRootPath())
       
           document.createParagraph("""
           Obscure views into projects/modules... 
  
  
  
  1.53      +13 -0     gump/python/gump/model/workspace.py
  
  Index: workspace.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/model/workspace.py,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- workspace.py	8 Jul 2004 20:33:07 -0000	1.52
  +++ workspace.py	13 Jul 2004 18:44:36 -0000	1.53
  @@ -156,6 +156,19 @@
       def getServers(self):
           return self.servers.values()
           
  +    def getPythonServers(self):
  +        """
  +        	Return the Python servers
  +        """
  +        return [server for server in self.getServers() if server.isPython() ]
  +        
  +    def hasMultiplePythonServers(self):
  +        """
  +        	Has more than one server (typically, for assuming that this one
  +        	is the one, if one, so not doing server stuff).
  +        """
  +        return len(self.getPythonServers()) > 1
  +        
       def getSortedServers(self):
           return self.sortedServers
   
  
  
  
  1.6       +11 -30    gump/python/gump/build/script.py
  
  Index: script.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/build/script.py,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- script.py	8 Jul 2004 20:33:10 -0000	1.5
  +++ script.py	13 Jul 2004 18:44:36 -0000	1.6
  @@ -48,9 +48,15 @@
   class ScriptBuilder(RunSpecific):
       
       def __init__(self,run):
  +        """
  +        A script 'builder'
  +        """
           RunSpecific.__init__(self,run)
   
       def buildProject(self,project,stats):
  +        """
  +        Run a project's script (a .bat or a .sh as appropriate)
  +        """
           
           workspace=self.run.getWorkspace()
                    
  @@ -85,9 +91,7 @@
           """ Return the command object for a <script entry """
           script=project.script
              
  -        #
           # Where to run this:
  -        #
           basedir = script.getBaseDirectory() or project.getBaseDirectory()
   
           # Add .sh  or .bat as appropriate to platform
  @@ -96,11 +100,8 @@
               scriptfullname += '.sh'
           else:
               scriptfullname += '.bat'
  -      
  -        # Optional 'verbose' or 'debug'
  -        #verbose=script.isVerbose()
  -        #debug=script.isDebug()
  -       
  +  
  +        # The script
           scriptfile=os.path.abspath(os.path.join(basedir, scriptfullname))
           
           # Not sure this is relevent...
  @@ -108,33 +109,13 @@
   
           cmd=Cmd(scriptfile,'buildscript_'+project.getModule().getName()+'_'+project.getName(),\
               basedir,{'CLASSPATH':classpath})    
  -            
  -        # Set this as a system property. Setting it here helps JDK1.4+
  -        # AWT implementations cope w/o an X11 server running (e.g. on
  -        # Linux)
  -        #    
  -        # Per GUMP-48 scripts do not want this.
  -        # cmd.addPrefixedParameter('-D','java.awt.headless','true','=')
  -    
  -        #
  -        # Add BOOTCLASSPATH
  -        #
  -        # Per GUMP-48 scripts do not want this.
  -        #if bootclasspath:
  -        #    cmd.addPrefixedParameter('-X','bootclasspath/p',bootclasspath,':')
  -                    
  -        #
  -        # Allow script-level debugging...
  -        #
  -        # Per GUMP-48 scripts do not want this.        
  -        #if project.getWorkspace().isDebug() or project.isDebug() or debug:
  -        #    cmd.addParameter('-debug')  
  -        #if project.getWorkspace().isVerbose()  or project.isVerbose() or verbose:
  -        #    cmd.addParameter('-verbose')  
           
           return cmd
           
           
       def preview(self,project,stats):        
  +        """
  +        Preview what this would do
  +        """
           command=self.getScriptCommand(project) 
           command.dump()
  
  
  
  1.6       +34 -66    gump/python/gump/build/ant.py
  
  Index: ant.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/build/ant.py,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ant.py	8 Jul 2004 20:33:09 -0000	1.5
  +++ ant.py	13 Jul 2004 18:44:36 -0000	1.6
  @@ -16,7 +16,7 @@
   # limitations under the License.
   
   """
  -
  +	An Ant builder (uses ant to build projects)
   """
   
   import os.path
  @@ -26,10 +26,8 @@
   from gump.core.gumprun import *
   from gump.core.config import dir, default, basicConfig
   
  -from gump.build.abstract import AbstractJavaBuilder
  +import gump.build.abstract
   
  -from gump.utils import dump, display, getIndent, logResourceUtilization, \
  -                            invokeGarbageCollection
   from gump.utils.note import Annotatable
   from gump.utils.work import *
   
  @@ -42,52 +40,53 @@
   from gump.model.stats import *
   from gump.model.state import *
   
  -
  -###############################################################################
  -# Classes
  -###############################################################################
  -
  -class AntBuilder(AbstractJavaBuilder):
  +class AntBuilder(gump.build.abstract.AbstractJavaBuilder):
       
       def __init__(self,run):
  -        AbstractJavaBuilder.__init__(self,run)
  -
  +        """
  +        	The Ant Builder is a Java Builder
  +    	""" 
  +        gump.build.abstract.AbstractJavaBuilder.__init__(self,run)
   
       def buildProject(self,project,stats):
  +        """
  +        	Build a project using Ant, based off the <ant metadata.
  +        	
  +        	Note: switch on -verbose|-debug based of the stats for this
  +        	project, i.e. how long in a state of failure.
  +        """
           
           workspace=self.run.getWorkspace()
                    
           log.info('Run Ant on Project: #[' + `project.getPosition()` + '] : ' + project.getName())
       
  -        #
           # Get the appropriate build command...
  -        #
           cmd=self.getAntCommand(project, self.run.getEnvironment().getJavaCommand())
   
           if cmd:
               # Execute the command ....
               cmdResult=execute(cmd,workspace.tmpdir)
       
  -            # Update Context    
  +            # Update context with the fact that this work was done
               work=CommandWorkItem(WORK_TYPE_BUILD,cmd,cmdResult)
               project.performedWork(work)
               project.setBuilt(1)
                       
  -            # Update Context w/ Results  
  +            # Update context state based of the result  
               if not cmdResult.state==CMD_STATE_SUCCESS:
                   reason=REASON_BUILD_FAILED
                   if cmdResult.state==CMD_STATE_TIMED_OUT:
                       reason=REASON_BUILD_TIMEDOUT
  -                project.changeState(STATE_FAILED,reason)
  -                        
  +                project.changeState(STATE_FAILED,reason)                        
               else:                         
                   # For now, things are going good...
                   project.changeState(STATE_SUCCESS)
  -   
  -    #
  -    # Build an ANT command for this project
  -    #        
  +    
       def getAntCommand(self,project,javaCommand='java'):
  +        """
  +        	Build an ANT command for this project, based on the <ant metadata
  +   			select targets and build files as appropriate.     	
  +        """
           
           # The original model information...
           ant=project.ant
  @@ -101,80 +100,46 @@
           verbose=ant.isVerbose()
           debug=ant.isDebug()
       
  -        #
           # Where to run this:
  -        #
           basedir = ant.getBaseDirectory() or project.getBaseDirectory()
       
  -        #
           # Build a classpath (based upon dependencies)
  -        #
           (classpath,bootclasspath)=project.getClasspaths()
       
  -        #
           # Get properties
  -        #
           properties=self.getAntProperties(project)
      
  -        #
  -        # Get properties
  -        #
  +        # Get system properties
           sysproperties=self.getAntSysProperties(project)
      
  -        #
  -        # Get properties
  -        #
  -        jvmargs=self.getJVMArgs(project)
  -   
  -        #
           # Run java on apache Ant...
  -        #
           cmd=Cmd(javaCommand,'build_'+project.getModule().getName()+'_'+project.getName(),\
               basedir,{'CLASSPATH':classpath})
               
           # These are workspace + project system properties
           cmd.addNamedParameters(sysproperties)
           
  -        
  -        # :NOTE: Commented out since <sysproperty was implemented.
  -        #
  -        # Set this as a system property. Setting it here helps JDK1.4+
  -        # AWT implementations cope w/o an X11 server running (e.g. on
  -        # Linux)
  -        # cmd.addPrefixedParameter('-D','java.awt.headless','true','=')
  -    
  -    
  -        # :NOTE: Commented out since <sysproperty was implemented.
  -        #
  -        # This helps ant maintain VM information for sub-VMs it launches.
  -        #
  -        # cmd.addPrefixedParameter('-D','build.clonevm','true','=')
  -        
  -        #
           # Add BOOTCLASSPATH
  -        #
           if bootclasspath:
               cmd.addPrefixedParameter('-X','bootclasspath/p',bootclasspath,':')
               
  +        # Get/set JVM properties
  +        jvmargs=self.getJVMArgs(project)
           if jvmargs:
               cmd.addParameters(jvmargs)
               
  +        # The Ant interface
           cmd.addParameter('org.apache.tools.ant.Main')  
       
  -        #
           # Allow ant-level debugging...
  -        #
           if project.getWorkspace().isDebug() or project.isDebug() or debug: 
               cmd.addParameter('-debug')  
           if project.getWorkspace().isVerbose()  or project.isVerbose() or verbose: 
               cmd.addParameter('-verbose')  
  -        
  -        #
  -        #	This sets the *defaults*, a workspace could override them.
  -        #        
  -        # :NOTE: Commented out since <property on workspace works.
  -        # cmd.addPrefixedParameter('-D','build.sysclasspath','only','=')
       
  +        # Some builds might wish for this information
  +        # :TODO: Grant greater access to Gump variables from
  +        # within.
           mergeFile=project.getWorkspace().getMergeFile()
           if mergeFile:
               cmd.addPrefixedParameter('-D','gump.merge',str(mergeFile),'=')        
  @@ -186,7 +151,7 @@
           # Pass the buildfile
           if buildfile: cmd.addParameter('-f',buildfile)
       
  -        # End with the target...
  +        # End with the target (or targets)...
           if target: 
               for targetParam in target.split():
                   cmd.addParameter(targetParam)
  @@ -194,20 +159,23 @@
           return cmd
     
       def getAntProperties(self,project):
  -        """Get properties for a project"""
  +        """ Get properties for a project """
           properties=Parameters()
           for property in project.getWorkspace().getProperties()+project.getAnt().getProperties():
               properties.addPrefixedNamedParameter('-D',property.name,property.value,'=')
           return properties
   
       def getAntSysProperties(self,project):
  -        """Get sysproperties for a project"""
  +        """ Get sysproperties for a project """
           properties=Parameters()
           for property in project.getWorkspace().getSysProperties()+project.getAnt().getSysProperties():
               properties.addPrefixedNamedParameter('-D',property.name,property.value,'=')
           return properties
                   
       def preview(self,project,stats):        
  +        """
  +        	Preview what an Ant build would look like.
  +        """
           command=self.getAntCommand(project) 
           command.dump()
    
  
  
  
  1.4       +5 -23     gump/python/gump/build/abstract.py
  
  Index: abstract.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/build/abstract.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- abstract.py	8 Jul 2004 20:33:09 -0000	1.3
  +++ abstract.py	13 Jul 2004 18:44:36 -0000	1.4
  @@ -17,39 +17,21 @@
   
   """
   
  -"""
  +	An Abstract Java Builder, with the ability to get JVM arguments
   
  -import os.path
  -import sys
  +"""
   
   from gump import log
  -from gump.core.gumprun import *
  -from gump.core.config import dir, default, basicConfig
  -
  -from gump.utils import dump, display, getIndent, logResourceUtilization, \
  -                            invokeGarbageCollection
  -from gump.utils.note import Annotatable
  -from gump.utils.work import *
  -from gump.utils.domutils import *
  -
  -from gump.utils.tools import *
  -
  -from gump.model.workspace import *
  -from gump.model.module import Module
  -from gump.model.project import Project
  -from gump.model.depend import  ProjectDependency
  -from gump.model.stats import *
  -from gump.model.state import *
  -
  +import gump.core.gumprun
   
   ###############################################################################
   # Classes
   ###############################################################################
   
  -class AbstractJavaBuilder(RunSpecific):
  +class AbstractJavaBuilder(gump.core.gumprun.RunSpecific):
       
       def __init__(self,run):
  -        RunSpecific.__init__(self,run)
  +        gump.core.gumprun.RunSpecific.__init__(self,run)
   
       def getJVMArgs(self,project):
           """Get JVM arguments for a project"""
  
  
  
  1.2       +1 -1      gump/python/gump/test/resources/full1/server3.xml
  
  Index: server3.xml
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/test/resources/full1/server3.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- server3.xml	10 Apr 2004 23:09:29 -0000	1.1
  +++ server3.xml	13 Jul 2004 18:44:36 -0000	1.2
  @@ -15,7 +15,7 @@
     limitations under the License.
   -->
   
  -<server name="try" type="python" status="up">
  +<server name="try" type="traditional" status="up">
     <attribution>Sybase Corporation</attribution>
     <title>TrySybase</title>
     <url>http://gump.try.sybase.com</url>
  
  
  
  1.2       +1 -1      gump/python/gump/test/resources/full1/server2.xml
  
  Index: server2.xml
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/test/resources/full1/server2.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- server2.xml	1 Mar 2004 21:28:00 -0000	1.1
  +++ server2.xml	13 Jul 2004 18:44:36 -0000	1.2
  @@ -1,6 +1,6 @@
   <?xml version="1.0" encoding="ISO-8859-1"?>
   
  -<server name="server2" type="python">
  +<server name="server2" type="traditional">
     <title>Server 2</title>
     <url>http://gump.apache.org</url>
   </server>
  
  
  

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