gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject cvs commit: jakarta-gump/repository apache-incubator-svn.xml
Date Wed, 03 Dec 2003 18:36:13 GMT
ajack       2003/12/03 10:36:13

  Modified:    python/gump engine.py config.py
               python/gump/output statsdb.py xref.py
               python/gump/utils launcher.py work.py tools.py __init__.py
                        note.py
               project  directory-naming.xml
               python/gump/model project.py object.py
               python/gump/document text.py xdoc.py forrest.py
               repository apache-incubator-svn.xml
  Log:
  1) Dates/Times
  2) Re-worked documentation to be clearer for projects/modules 
  [grouped the clutter, one day will only add thing if debug or verbose]
  3) Added more stuff to try to figure out <junitreport 
  [dims, be patient w/ me, I'll get there. :-) ]
  4) Write a big red <warning> if there as "nasties" warn/error in annotatons.
  
  Revision  Changes    Path
  1.35      +7 -1      jakarta-gump/python/gump/engine.py
  
  Index: engine.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/engine.py,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- engine.py	3 Dec 2003 04:29:05 -0000	1.34
  +++ engine.py	3 Dec 2003 18:36:13 -0000	1.35
  @@ -472,6 +472,7 @@
                       #
                       dirs=[]
                       dircnt=0
  +                    listed=0
                       for jar in project.getJars():
                           jarPath=os.path.abspath(jar.getPath())
                           dir=os.path.dirname(jarPath)
  @@ -480,8 +481,12 @@
                               listDirectoryAsWork(project,dir,\
                                   'list_'+project.getName()+'_dir'+str(dircnt)+'_'+os.path.basename(dir))
                               dirs.append(dir)
  +                            listed += 1
                           else:
                               project.addWarning("No such directory (where output is expect)
: " + dir)
  +                            
  +                    if listed:
  +                        project.addError("See Directory Listing Work for Missing Outputs")
               else:
                   project.changeState(STATE_SUCCESS)
            
  @@ -489,7 +494,8 @@
           # Display report output...
           #
           for report in project.getReports():
  -            reportDir=report.getResolvedPath()
  +            reportDir=report.getResolvedPath() 
  +            project.addInfo('Reports in: ' + reportDir)
               catDirectoryContentsAsWork(project,reportDir)
       
                   
  
  
  
  1.8       +2 -1      jakarta-gump/python/gump/config.py
  
  Index: config.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/config.py,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- config.py	26 Nov 2003 16:08:39 -0000	1.7
  +++ config.py	3 Dec 2003 18:36:13 -0000	1.8
  @@ -126,7 +126,8 @@
       # :TODO: Add "minimum version" checks...
       ws_version="0.4"
       
  -    datetimeformat="%a, %d %b %Y %H:%M:%S (%Z)"
  +    datetimeformat='%a, %d %b %Y %H:%M:%S (%Z)'
  +    timeformat='%H:%M:%S (%Z)'
       
       timeout=60*60 # 60 minutes (in seconds)
       
  
  
  
  1.3       +2 -2      jakarta-gump/python/gump/output/statsdb.py
  
  Index: statsdb.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/output/statsdb.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- statsdb.py	20 Nov 2003 21:30:06 -0000	1.2
  +++ statsdb.py	3 Dec 2003 18:36:13 -0000	1.3
  @@ -355,8 +355,8 @@
               round(self.projectsInWorkspace/self.modulesInWorkspace,2)
           
   def sortByElapsed(module1,module2):
  -    elapsed1=module1.elapsedSecs()
  -    elapsed2=module2.elapsedSecs()
  +    elapsed1=module1.getElapsedSecs()
  +    elapsed2=module2.getElapsedSecs()
       c = 0
       if elapsed1 > elapsed2: c = -1
       if elapsed1 < elapsed2: c = 1       
  
  
  
  1.3       +4 -3      jakarta-gump/python/gump/output/xref.py
  
  Index: xref.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/output/xref.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- xref.py	2 Dec 2003 00:45:40 -0000	1.2
  +++ xref.py	3 Dec 2003 18:36:13 -0000	1.3
  @@ -98,6 +98,7 @@
       def mapPackages(self):
           for module in self.workspace.getModules():
               for project in module.getProjects():
  +                if project.isPackaged(): continue
                   for package in project.xml.package:
                       if package:
                           packageName=str(package)
  @@ -106,12 +107,12 @@
                                   self.packageToModule[packageName]=[]
                   
                           # Store
  -                        self.packageToModule[packageName].append(module)
  +                        if not module in self.packageToModule[packageName]:
  +                            self.packageToModule[packageName].append(module)
       
       def getRepositoryToModuleMap(self):
           return self.repositoryToModule
  -        
  -        
  +                
       def getPackageToModuleMap(self):
           return self.packageToModule
           
  
  
  
  1.3       +20 -17    jakarta-gump/python/gump/utils/launcher.py
  
  Index: launcher.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/utils/launcher.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- launcher.py	20 Nov 2003 00:57:40 -0000	1.2
  +++ launcher.py	3 Dec 2003 18:36:13 -0000	1.3
  @@ -240,17 +240,20 @@
           self.cmd=cmd
           self.state=CMD_STATE_NOT_YET_RUN
           self.output=None
  -        self.elapsed=0
           self.signal=0
           self.exit_code=-1
           
  +        # To calculate elapsed
  +        self.start_time=None
  +        self.end_time=None
  +        
       def overview(self,indent):
           overview + indent+"State: " + states[self.state]
           overview += self.cmd.overview(indent)
           if self.output:
             overview += indent+"Output: " + self.output
  -        if self.elapsed:
  -          overview += indent+"Elapsed: " + str(self.elapsed)
  +        if self.hasTimes():
  +          overview += indent+"Elapsed: " + str(self.getElapsedTime())
           if self.signal:
             overview += indent+"Termination Signal: " + str(self.signal)
           if self.exit_code:
  @@ -274,21 +277,22 @@
       def getOutput(self):
           return self.output
           
  +    def hasTimes(self):
  +        if self.start_time and self.end_time: return 1
  +        return 0
  +        
  +    def getStartTimeSecs(self):
  +        return self.start_time
  +        
  +    def getEndTimeSecs(self):
  +        return self.end_time
  +        
  +    def getElapsedSecs(self):
  +        return int(round(self.end_time-self.start_time,0))        
  +        
       def dump(self,indent):
           print self.overview(indent)
   
  -# Testing
  -def dummyExecute(cmd,tmp=dir.tmp):
  -    res=CmdResult(cmd)
  -    return dummyExecuteIntoResult(cmd,res,tmp)
  -	
  -# Testing
  -def dummyExecuteIntoResult(cmd,result,tmp=dir.tmp):
  -    result.elapsed=5.1
  -    result.exit_code=0
  -    result.state=CMD_STATE_SUCCESS  
  -    return result
  -
   def killChildProcesses():
       gumpid=default.gumpid
       log.warn('Kill all child processed (anything launched by Gumpy) [PID' + str(gumpid)
+ ']')    
  @@ -458,8 +462,7 @@
         end_time=time.time()
         result.start_time=start_time
         result.end_time=end_time
  -      result.elapsed=int(round(end_time-start_time,0))
  -        
  +      
         # Restore environment.
         if cmd.cwd: os.chdir(originalCWD)
         for envKey in originalENV.iterkeys():
  
  
  
  1.4       +60 -49    jakarta-gump/python/gump/utils/work.py
  
  Index: work.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/utils/work.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- work.py	2 Dec 2003 17:54:22 -0000	1.3
  +++ work.py	3 Dec 2003 18:36:13 -0000	1.4
  @@ -127,16 +127,32 @@
   
   class TimedWorkItem(WorkItem):
       """ Unit of Work w/ times """
  -    def __init__(self,name,type,state,secs,message=''):
  +    def __init__(self,name,type,state,startSecs,endSecs,message=''):
           WorkItem.__init__(self,name,type,state,message)
  -        self.secs=secs
  -                 
  -    def elapsedTime(self):   
  -        return secsToElapsedTime(self.secs or 0)
  +        self.startSecs=startSecs
  +        self.endSecs=endSecs
  +    
  +    def hasTimes(self):
  +        if self.startSecs and self.endSecs: return 1
  +        return 0
  +        
  +    def getStartTimeSecs(self):   
  +        return self.startSecs
  +        
  +    def getEndTimeSecs(self):   
  +        return self.endSecs
  +        
  +    def getElapsedSecs(self):   
  +        if self.hasTimes():
  +            return int(round(self.endSecs-self.startSecs,0))
  +        return 0
  +        
  +    def getElapsedTime(self):   
  +        return secsToElapsedTime(self.getElapsedSecs())
            
       def overview(self):
           overview=WorkItem.overview(self)
  -        (hours,mins,secs)=self.elapsedTime()
  +        (hours,mins,secs)=self.getElapsedTime()
           overview+='Elapsed: '
           overview+=str(hours) + ' hours, ' 
           overview+=str(mins) + ' minutes, ' 
  @@ -144,14 +160,16 @@
           return overview
           
       def clone(self):
  -        return TimedWorkItem(self.name,self.type,self.state,self.secs,self.message)
  +        return TimedWorkItem(self.name,self.type,self.state,self.startSecs,self.endSecs,self.message)
           
   class CommandWorkItem(TimedWorkItem):
       """ Unit of Work"""
       def __init__(self,type,command,result=None,message=''):
           if not result: result=CmdResult(command)
           TimedWorkItem.__init__(self,command.name,type,\
  -                commandStateToWorkState(result.state),result.elapsed,message)
  +                commandStateToWorkState(result.state),	\
  +                result.getStartTimeSecs(),	\
  +                result.getEndTimeSecs(),message)
           self.command=command
           self.result=result
           
  @@ -202,30 +220,32 @@
           # Let this item know it's owner
           item.setOwner(self.getOwner())
       
  -    def elapsedSecs(self):
  +    def getStartSecs(self):
  +        startSecs=0
  +        for item in self:
  +            if isinstance(item,TimedWorkItem): 
  +                if not startSecs or item.getStartTimeSecs() < startSecs:
  +                    startSecs=item.getStartTimeSecs()
  +        if startSecs: return startSecs
  +    
  +    def getEndSecs(self):
  +        endSecs=0
  +        for item in self:
  +            if isinstance(item,TimedWorkItem): 
  +                if not endSecs or item.getEndSecs() < endSecs:
  +                    endSecs=item.getEndSecs()
  +        if endSecs: return endSecs
  +    
  +    def getElapsedSecs(self):
           elapsedSecs=0
           for item in self:
  -            if isinstance(item,TimedWorkItem): elapsedSecs += item.secs
  +            if isinstance(item,TimedWorkItem): 
  +                elapsedSecs += item.getElapsedSecs()
           return elapsedSecs
       
  -    def elapsedTime(self):   
  -        secs 	= self.elapsedSecs();
  -        if secs > 3600:
  -            hours	=	int(secs / 3600)
  -            secs	%=	3600
  -        else:
  -            hours	=	0
  -            
  -        if secs > 60:
  -            mins	=	int(secs / 60)
  -            secs	%=	60
  -        else:
  -            mins 	= 	0
  -                    
  -        secs 	=	int(round(secs,0))        
  -    
  -        return (hours, mins, secs)
  -        
  +    def getElapsedTime(self):   
  +        return secsToElapsedTime(self.getElapsedSecs())
  +                
       def clone(self):
           cloned=WorkList()
           for item in self:
  @@ -246,24 +266,15 @@
       def okToPerformWork(self):
           return self.isUnset() or self.isSuccess()        
                  
  -    #
  -    # Return a triple of hours/minutes/seconds for total
  -    # elapsed time for this context and sub-contexts.
  -    #
  -    def elapsedTime(self):   
  -        secs 	= self.elapsedSecs();
  -        if secs > 3600:
  -            hours	=	int(secs / 3600)
  -            secs	%=	3600
  -        else:
  -            hours	=	0
  -            
  -        if secs > 60:
  -            mins	=	int(secs / 60)
  -            secs	%=	60
  -        else:
  -            mins 	= 	0
  -            
  -        secs 	=	int(round(secs,0))
  -        
  -        return (hours, mins, secs)
  \ No newline at end of file
  +    def getStartSecs(self):
  +        return self.worklist.getStartSecs()   
  +          
  +    def getEndSecs(self):
  +        return self.worklist.getEndSecs()       
  +               
  +    def getElapsedSecs(self):
  +        return self.worklist.getElapsedSecs()
  +    
  +    def getElapsedTime(self):   
  +        return self.worklist.getElapsedTime()
  +    
  
  
  
  1.5       +5 -1      jakarta-gump/python/gump/utils/tools.py
  
  Index: tools.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/utils/tools.py,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- tools.py	2 Dec 2003 17:36:40 -0000	1.4
  +++ tools.py	3 Dec 2003 18:36:13 -0000	1.5
  @@ -93,7 +93,11 @@
               for fileName in os.listdir(directory):
                   file=os.path.abspath(os.path.join(directory,fileName))                
                   if os.path.exists(file) and os.path.isfile(file):
  -                    catFileAsWork(workable,	file, name+'_'+fileName)
  +                    if name: 
  +                        name=name+'_'+fileName
  +                    else:
  +                        name=fileName
  +                    catFileAsWork(workable,	file, name)
       except:
           try:
               workable.addWarning('No such directory [' + str(directory) + ']')
  
  
  
  1.7       +23 -10    jakarta-gump/python/gump/utils/__init__.py
  
  Index: __init__.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/utils/__init__.py,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- __init__.py	24 Nov 2003 18:32:20 -0000	1.6
  +++ __init__.py	3 Dec 2003 18:36:13 -0000	1.7
  @@ -190,7 +190,7 @@
       if not f: f = sys.stdout
       f.write( '%s\n' % (indent + ' ----------------------------------------------------
Gump'))
   
  -def secsToElapsedTime(secs):   
  +def secsToElapsedTimeTriple(secs):   
       # Extract Hours
       if secs > 3600:
           hours	=	int(secs / 3600)
  @@ -210,10 +210,10 @@
           
       return (hours, mins, secs)
       
  -def secsToString(secs):
  -    return elapsedTimeToString(secsToElapsedTime(secs))           
  +def secsToElapsedString(secs):
  +    return elapsedTimeTripleToString(secsToElapsedTimeTriple(secs))           
       
  -def elapsedTimeToString(elapsed):
  +def elapsedTimeTripleToString(elapsed):
       elapsedString=''
       
       (hours,mins,secs) = elapsed
  @@ -237,6 +237,10 @@
       
   def secsToDate(secs):
       return time.strftime(setting.datetimeformat, \
  +                    time.localtime(secs))    
  +                     
  +def secsToTime(secs):
  +    return time.strftime(setting.timeformat, \
                       time.localtime(secs))                    
                   
   def getGeneralSinceDescription(secs, since=None):
  @@ -248,6 +252,8 @@
           diffString='~ '
           diffSecs=newerSecs - olderSecs
           
  +        diffSecs	=	int(diffSecs)
  +        diffMins	=	int(diffSecs / 60)
           diffHours	=	int(diffSecs / 3600)
           diffDays	=	int(diffHours / 24)
           diffWeeks	=	int(diffDays / 7)
  @@ -269,12 +275,18 @@
           elif diffHours:
               diffString += str(diffHours) + ' hour'
               if diffHours > 1: diffString += 's'
  +        elif diffMins:
  +            diffString += str(diffMins) + ' min'
  +            if diffMins > 1: diffString += 's'
  +        elif diffSecs:
  +            diffString += str(diffSecs) + ' sec'
  +            if diffSecs > 1: diffString += 's'
           else:
  -            diffString = ''
  +            diffString = 'This run: ' + secsToTime(newerSecs)
       elif olderSecs == newerSecs:
  -        diffString = 'This run'
  +        diffString = 'This run: ' + secsToTime(newerSecs)
       else:
  -        diffString = ''
  +        diffString = 'N/A'
       
       return diffString
       
  @@ -327,9 +339,10 @@
     
     #dump(log)
   
  -  print "secsToElapsedTime(1340) : " + str(secsToElapsedTime(1340))
  -  print "secsToString(1340) : " + secsToString(1340)
  -  print "elapsedTimeToString(secsToElapsedTime(1340)) : " + elapsedTimeToString(secsToElapsedTime(1340))
  +  print "secsToElapsedTimeTriple(1340) : " + str(secsToElapsedTimeTriple(1340))
  +  print "secsToElapsedString(1340) : " + secsToElapsedString(1340)
  +  print "secsToTime(1340) : " + secsToTime(1340)
  +  print "elapsedTimeToString(secsToElapsedTime(1340)) : " + elapsedTimeTripleToString(secsToElapsedTimeTriple(1340))
     
     print "str = " + getStringFromUnicode("Ceki Gülcü")
     
  
  
  
  1.2       +11 -0     jakarta-gump/python/gump/utils/note.py
  
  Index: note.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/utils/note.py,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- note.py	20 Nov 2003 20:51:49 -0000	1.1
  +++ note.py	3 Dec 2003 18:36:13 -0000	1.2
  @@ -124,6 +124,17 @@
       def getAnnotations(self):
           return self.annotations
           
  +    def containsNasties(self):
  +        return self.containsOrAbove(LEVEL_WARNING)
  +        
  +    def containsOrAbove(self,level):
  +        for note in self.annotations:
  +            if note.level >= level:
  +                return 1
  +        return 0
  +        
  +        
  +        
       def dump(self, indent=0, output=sys.stdout):
           """ Display the contents of this object """         
           if self.annotations:
  
  
  
  1.4       +1 -1      jakarta-gump/project/directory-naming.xml
  
  Index: directory-naming.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/project/directory-naming.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- directory-naming.xml	2 Dec 2003 00:45:41 -0000	1.3
  +++ directory-naming.xml	3 Dec 2003 18:36:13 -0000	1.4
  @@ -4,7 +4,7 @@
     <description>Apache Directory Naming Component</description>
     <url href="http://incubator.apache.org/directory/naming/"/>
     
  -  <svn repository="apache-incubator-svn" dir="naming"/>
  +  <svn repository="apache-incubator-svn" dir="directory/naming/"/>
     
     <project name="directory-naming">
       <ant buildfile="build.xml" target="dist">
  
  
  
  1.22      +27 -0     jakarta-gump/python/gump/model/project.py
  
  Index: project.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/model/project.py,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- project.py	2 Dec 2003 17:36:40 -0000	1.21
  +++ project.py	3 Dec 2003 18:36:13 -0000	1.22
  @@ -275,6 +275,10 @@
       def getJars(self):
           return self.jars.values()
           
  +    def hasReports(self):
  +        if self.reports: return 1
  +        return 0
  +        
       def getReports(self):
           return self.reports
       
  @@ -333,6 +337,29 @@
           
       def getFOGFactor(self):
           return self.getStats().getFOGFactor()
  +        
  +    def determineAffected(self):
  +        affected=0
  +        
  +        # Get all dependenees (optional/otherwise)
  +        dependees=self.getFullDependees()
  +        
  +        # Look through all dependees
  +        for dependee in dependees:
  +            project=dependee.getOwnerProject()
  +            
  +            cause=project.getCause()
  +            #
  +            # Something caused this some grief
  +            #
  +            if cause:
  +                #
  +                # The something was this module or one of it's projects
  +                #
  +                if cause == self:
  +                    affected += 1            
  +        
  +        return affected
           
       def propagateErrorStateChange(self,state,reason,cause,message):
           
  
  
  
  1.12      +3 -3      jakarta-gump/python/gump/model/object.py
  
  Index: object.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/model/object.py,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- object.py	2 Dec 2003 23:58:47 -0000	1.11
  +++ object.py	3 Dec 2003 18:36:13 -0000	1.12
  @@ -197,11 +197,11 @@
           
       # Somewhat bogus...
       
  -    def elapsedSecs(self):
  -        elapsedSecs=self.worklist.elapsedSecs()
  +    def getElapsedSecs(self):
  +        elapsedSecs=self.worklist.getElapsedSecs()
           if hasattr(self,'getChildren'):
               for object in self.getChildren():
  -                elapsedSecs += object.elapsedSecs()
  +                elapsedSecs += object.getElapsedSecs()
           return int(round(elapsedSecs,0))
       
       def aggregateStates(self, states=None):
  
  
  
  1.4       +3 -2      jakarta-gump/python/gump/document/text.py
  
  Index: text.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/document/text.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- text.py	1 Dec 2003 17:34:07 -0000	1.3
  +++ text.py	3 Dec 2003 18:36:13 -0000	1.4
  @@ -97,7 +97,7 @@
           output=self.output
               
           output.write(indent + "Workspace State : " + workspace.getStateDescription() +
"\n")
  -        output.write(indent + "Workspace Secs : " + str(workspace.elapsedSecs()) + "\n")
  +        output.write(indent + "Workspace Secs : " + str(workspace.getElapsedSecs()) + "\n")
       
           output.write(indent + "Modules: " + str(len(workspace.getModules())) + "\n")
       
  @@ -121,7 +121,8 @@
   
       def documentWork(self, indent, workable):
           output=self.output    
  -        output.write(indent+"Work [" + str(len(workable.worklist)) + "] [" + str(workable.elapsedSecs())
+ "] secs."  + "\n")
  +        output.write(indent+"Work [" + str(len(workable.worklist)) \
  +                + "] [" + str(workable.getElapsedSecs()) + "] secs."  + "\n")
       
           for work in workable.worklist:
               output.write(indent+"Work : " + stateName(work.state) + "\n")
  
  
  
  1.5       +24 -0     jakarta-gump/python/gump/document/xdoc.py
  
  Index: xdoc.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/document/xdoc.py,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- xdoc.py	1 Dec 2003 20:55:50 -0000	1.4
  +++ xdoc.py	3 Dec 2003 18:36:13 -0000	1.5
  @@ -269,6 +269,9 @@
       def createNote(self,text=None):
           return self.storePiece(XDocNote(self.createSubContext(),text))         
               
  +    def createWarning(self,text=None):
  +        return self.storePiece(XDocWarning(self.createSubContext(),text))         
  +            
       def createSource(self,text=None):
           return self.storePiece(XDocSource(self.createSubContext(),text))         
            
  @@ -503,6 +506,27 @@
           
       def end(self):
           self.context.writeLine('</note>')
  +        
  +    def createText(self,text=None):
  +        return self.storePiece(XDocText(self.createSubContext(),text))          
  +        
  +    def createBreak(self):
  +        return self.storePiece(XDocBreak(self.createSubContext()))    
  +
  +    def createStrong(self,text=None,transient=0):
  +        return self.storePiece(XDocStrong(self.createSubContext(transient),text))
  +
  +class XDocWarning(XDocPiece):
  +    def __init__(self,context,text):
  +        XDocPiece.__init__(self,context)
  +        if text:
  +            self.createText(text)
  +        
  +    def start(self):
  +        self.context.writeLineIndented('<warning>')
  +        
  +    def end(self):
  +        self.context.writeLine('</warning>')
           
       def createText(self,text=None):
           return self.storePiece(XDocText(self.createSubContext(),text))          
  
  
  
  1.26      +118 -62   jakarta-gump/python/gump/document/forrest.py
  
  Index: forrest.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/document/forrest.py,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- forrest.py	3 Dec 2003 04:29:05 -0000	1.25
  +++ forrest.py	3 Dec 2003 18:36:13 -0000	1.26
  @@ -299,9 +299,9 @@
           
           detailsSection=document.createSection('Details')
           detailsTable=detailsSection.createTable()
  -        detailsTable.createEntry("State : ", workspace.getStateDescription())    
  -        (hours, mins, secs) 	= workspace.elapsedTime();
  -        detailsTable.createEntry("Elapsed Time : ", str(hours) + ':' + str(mins) + ':'
+ str(secs))
  +        detailsTable.createEntry("State : ", workspace.getStateDescription()) 
  +        
  +        detailsTable.createEntry("Elapsed Time : ", secsToElapsedString(workspace.getElapsedSecs()))
           detailsTable.createEntry("Base Directory : ", workspace.getBaseDirectory())
           detailsTable.createEntry("Temporary Directory : ", workspace.tmpdir)
           #if workspace.scratchdir:
  @@ -369,7 +369,7 @@
           self.documentSummary(document, workspace.getProjectSummary())
           
           projectsSection=document.createSection('Projects (in build order)')
  -        projectsTable=projectsSection.createTable(['Name','Project State','Duration\nin
state','Last Updated','Elapsed'])
  +        projectsTable=projectsSection.createTable(['Time','Updated','Name','Project State','Duration\nin
state','Last Updated','Elapsed'])
           pcount=0
           for project in gumpSet.getSequence():
               # :TODO: Next line irrelevent?
  @@ -378,14 +378,19 @@
               pcount+=1
       
               projectRow=projectsTable.createRow()            
  -            projectRow.createComment(project.getName())              
  +            projectRow.createComment(project.getName())  
  +            
  +            projectRow.createData(secsToTime(project.getStartSecs()))  
  +            
  +            projectRow.createData(secsToTime(project.getModule().getStartSecs()))     
       
  +                        
               self.insertLink(project,workspace,projectRow.createData())   
               self.insertStateIcon(project,workspace,projectRow.createData())      
               projectRow.createData(project.getStats().sequenceInState)    
               projectRow.createData(	\
                   getGeneralSinceDescription(	\
                       project.getModule().getStats().getLastUpdated()))
  -            projectRow.createData(elapsedTimeToString(project.elapsedTime())) 
  +            projectRow.createData(secsToElapsedString(project.getElapsedSecs())) 
                   
           if not pcount: projectsTable.createLine('None')
           
  @@ -412,7 +417,7 @@
               projectRow.createComment(project.getName())          
               self.insertLink(project,workspace,projectRow.createData())     
               self.insertStateIcon(project,workspace,projectRow.createData())    
  -            projectRow.createData(elapsedTimeToString(project.elapsedTime()))  
  +            projectRow.createData(secsToElapsedString(project.getElapsedSecs()))  
               
               projectRow.createData(round(project.getFOGFactor(),2))
                   
  @@ -429,7 +434,8 @@
           self.documentSummary(document, workspace.getProjectSummary())
           
           projectsSection=document.createSection('Projects with issues...')
  -        projectsTable=projectsSection.createTable(['Name','Project State','Elapsed'])
  +        projectsTable=projectsSection.createTable(['Name','Affected',	\
  +                    'Duration\nin state''Project State','Elapsed'])
           pcount=0
           for project in sortedProjectList:
               if not gumpSet.inSequence(project): continue       
  @@ -438,12 +444,26 @@
                   continue
                   
               pcount+=1
  -      
  +        
  +            #
  +            # Determine the number of projects this module (or it's projects)
  +            # cause not to be run.
  +            #
  +            affected=project.determineAffected()
  +            
  +            # How long been like this
  +            seq=stats=project.getStats().sequenceInState
  +                    
               projectRow=projectsTable.createRow()
               projectRow.createComment(project.getName())
  +                                    
               self.insertLink(project,workspace,projectRow.createData())   
  +                        
  +            projectRow.createData(affected)
  +            projectRow.createData(seq)
  +            
               self.insertStateIcon(project,workspace,projectRow.createData())
  -            projectRow.createData(elapsedTimeToString(project.elapsedTime())) 
  +            projectRow.createData(secsToElapsedString(project.getElapsedSecs())) 
                   
           if not pcount: projectsTable.createLine('None')    
           document.serialize()
  @@ -453,7 +473,7 @@
           #
           # module_todos.xml
           #
  -        document=XDocDocument('Modules with TODOs',
  +        document=XDocDocument('Modules with issues',
                       self.resolver.getFile(workspace,'module_todos'),)            
           self.documentSummary(document, workspace.getProjectSummary())
           
  @@ -503,7 +523,7 @@
               self.insertStateIcon(module,workspace,moduleRow.createData())
               self.insertStateIcons(gumpSet,module,workspace,moduleRow.createData())
               
  -            moduleRow.createData(elapsedTimeToString(module.elapsedTime()))
  +            moduleRow.createData(secsToElapsedString(module.getElapsedSecs()))
               
           if not mcount: modulesTable.createLine('None')
       
  @@ -535,7 +555,7 @@
               self.insertStateIcon(module,workspace,moduleRow.createData())
               self.insertStateIcons(gumpSet,module,workspace,moduleRow.createData())
               
  -            moduleRow.createData(elapsedTimeToString(module.elapsedTime()))
  +            moduleRow.createData(secsToElapsedString(module.getElapsedSecs()))
               moduleRow.createData(round(module.getFOGFactor(),2))
               
           if not mcount: modulesTable.createLine('None')
  @@ -573,7 +593,7 @@
               self.insertLink( module, workspace, moduleRow.createData())
               self.insertStateIcon(module,workspace,moduleRow.createData())
               self.insertStateIcons(gumpSet,module,workspace,moduleRow.createData())
  -            moduleRow.createData(elapsedTimeToString(module.elapsedTime()))
  +            moduleRow.createData(secsToElapsedString(module.getElapsedSecs()))
               
           if not mcount: mpkgTable.createLine('None')
           
  @@ -711,14 +731,24 @@
               description+=' (No module URL provided).'
                   
           descriptionSection.createParagraph().createRaw(description)
  +
  +        stateSection=document.createSection('State')
  +        stateList=stateSection.createList()
  +        stateList.createEntry("State: " + module.getStateDescription())
  +        if not module.getReason() == REASON_UNSET:
  +            stateList.createEntry("Reason: ", module.getReasonDescription())
  +        if module.cause and not module==module.cause:
  +             self.insertTypedLink( module.cause, module, stateList.createEntry( "Root Cause:
")) 
  +             
  +        self.documentAnnotations(stateSection,module)
           
  +        projectsSection=document.createSection('Projects') 
           if (len(module.getProjects()) > 1):
  -            self.documentSummary(document,module.getProjectSummary())
  +            self.documentSummary(projectsSection,module.getProjectSummary())
               
  -        self.documentAnnotations(document,module)
                                     
           if (len(module.getProjects()) > 1):
  -            ptodosSection=document.createSection('Projects with TODOs')
  +            ptodosSection=projectsSection.createSection('Projects with Issues')
               ptodosTable=ptodosSection.createTable(['Name','State','Elapsed'])
               pcount=0
               for project in module.getProjects():     
  @@ -740,11 +770,11 @@
                   projectRow.createComment(project.getName())
                   self.insertLink(project,module,projectRow.createData())  
                   self.insertStateIcon(project,module,projectRow.createData())          
             
  -                projectRow.createData(elapsedTimeToString(project.elapsedTime())) 
  +                projectRow.createData(secsToElapsedString(project.getElapsedSecs())) 
   	            
   	        if not pcount: ptodosTable.createLine('None')
   	        
  -        pallSection=document.createSection('All Projects')
  +        pallSection=projectsSection.createSection('All Projects')
           pallTable=pallSection.createTable(['Name','State','Elapsed'])
           
           pcount=0
  @@ -757,7 +787,7 @@
               projectRow.createComment(project.getName())
               self.insertLink(project,module,projectRow.createData())
               self.insertStateIcon(project,module,projectRow.createData())              
         
  -            projectRow.createData(elapsedTimeToString(project.elapsedTime())) 
  +            projectRow.createData(secsToElapsedString(project.getElapsedSecs())) 
               
           if not pcount: pallTable.createLine('None')
           
  @@ -805,7 +835,7 @@
              
       #   x.write('<p><strong>Module Config :</strong> <link href=\'xml.html\'>XML</link></p>')
               
  -        self.documentXML(document,module)
  +        self.documentXML(detailSection,module)
           
           self.documentWorkList(document,module,'Module-level Work')
   
  @@ -847,53 +877,73 @@
               description=' (No project URL provided.)'   
                   
           projectsSection.createParagraph().createRaw(description)
  -    
  -        self.documentAnnotations(document,project)
  -        
  -        # Note: Leverages previous extraction from project statistics DB
  -        stats=project.getStats()
  +           
  +        stateSection=document.createSection('State')
           
  +        stateList=stateSection.createList()
  +        stateList.createEntry("State: ", project.getStateDescription())  
  +        if not project.getReason() == REASON_UNSET:
  +            stateList.createEntry("Reason: " + reasonString(project.getReason()))
  +            
  +        if project.cause and not project==project.cause:
  +             self.insertTypedLink( project.cause, project, stateList.createEntry( "Root
Cause: ")) 
  +             
  +        self.documentAnnotations(stateSection,project)        
  +            
           detailsSection=document.createSection('Details')
  +        
           detailsList=detailsSection.createList()
           detailsList.createEntry("State: ", project.getStateDescription())  
           if not project.getReason() == REASON_UNSET:
               detailsList.createEntry("Reason: " + reasonString(project.getReason()))
  +            
  +            
           self.insertLink(project.getModule(),project,detailsList.createEntry('Module: '))
           if project.hasCause() and not project==project.getCause():
               self.insertTypedLink(project.getCause(),project,detailsList.createEntry('Root
Cause: '))
  -        detailsList.createEntry("Elapsed: ", project.elapsedSecs())
  -        detailsList.createEntry("FOG Factor: ", round(stats.getFOGFactor(),2))
  -        detailsList.createEntry("Successes: ", stats.successes)
  -        detailsList.createEntry("Failures: ", stats.failures)
  -        detailsList.createEntry("Prerequisite Failures: ", stats.prereqs)
  -        detailsList.createEntry("Previous State: ", stateName(stats.previousState))
  -        
  -        if stats.first:
  -            detailsList.createEntry("First Success: ", secsToDate(stats.first))
  -        if stats.last:
  -            detailsList.createEntry("Last Success: ", secsToDate(stats.last))
  -            
  +        detailsList.createEntry("Elapsed: ", secsToElapsedString(project.getElapsedSecs()))
  +                                                      
           # Display nag information
           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)
  +                             
  +        # Note: Leverages previous extraction from project statistics DB
  +        stats=project.getStats()
  +        
  +        statsSection=detailsSection.createSection('Statistics')  
  +        statsTable=statsSection.createTable()           
  +        statsTable.createEntry("FOG Factor: ", round(stats.getFOGFactor(),2))
  +        statsTable.createEntry("Successes: ", stats.successes)
  +        statsTable.createEntry("Failures: ", stats.failures)
  +        statsTable.createEntry("Prerequisite Failures: ", stats.prereqs)
  +        statsTable.createEntry("Previous State: ", stateName(stats.previousState))
  +        
  +        if stats.first:
  +            statsTable.createEntry("First Success: ", secsToDate(stats.first))
  +        if stats.last:
  +            statsTable.createEntry("Last Success: ", secsToDate(stats.last))
               
  -        self.documentProjectList(document, "Project Dependencies",	project.getDependencies(),
0, project)  
  -        self.documentProjectList(document, "Project Dependees",		project.getDependees(),
1, project)
  -    
  -        if project.hasBuildCommand():
  -            (classpath,bootclasspath)=project.getClasspathLists()            
  -            self.displayClasspath(document, classpath,'Classpath',project)        
  -            self.displayClasspath(document, bootclasspath,'Boot Classpath',project)   

  -           
  +            
  +        self.documentProjectList(detailsSection, "Project Dependencies",	\
  +                    project.getDependencies(), 0, project)  
  +        self.documentProjectList(detailsSection, "Project Dependees",		\
  +                    project.getDependees(), 1, project)
  + 
       #    x.write('<p><strong>Project Config :</strong> <link href=\'%s\'>XML</link></p>'
\
       #                % (getModuleProjectRelativeUrl(modulename,project.name)) )
               
           self.documentWorkList(document,project,'Project-level Work')
  -        
  -        self.documentXML(document,project)
  +           
  +        miscSection=document.createSection('Miscellaneous')
  +        if project.hasBuildCommand():
  +            (classpath,bootclasspath)=project.getClasspathLists()            
  +            self.displayClasspath(miscSection, classpath,'Classpath',project)        
  +            self.displayClasspath(miscSection, bootclasspath,'Boot Classpath',project)
   
  +           
  +        self.documentXML(miscSection,project)
           
           document.serialize()
           
  @@ -909,7 +959,9 @@
       #    endXDoc(x)
       
       def displayClasspath(self,document,classpath,title,referencingObject):
  -         
  +        
  +        if not classpath.getPathParts(): return
  +        
           pathSection=document.createSection(title)
           pathTable=pathSection.createTable(['Path Entry','Contributor','Instigator','Annotation'])
      
           paths=0
  @@ -948,9 +1000,9 @@
           if not paths:        
               pathTable.createLine('No ' + title + ' entries')
                        
  -    def documentProjectList(self,document,title,dependencies,dependees,referencingObject):
  +    def documentProjectList(self,xdocNode,title,dependencies,dependees,referencingObject):
         if dependencies:
  -            projectSection=document.createSection(title)
  +            projectSection=xdocNode.createSection(title)
               projectTable=projectSection.createTable(['Name','Type','State'])
               for depend in dependencies:
                   if not dependees:
  @@ -968,12 +1020,16 @@
                   
                   self.insertStateDescription(project,referencingObject,projectRow.createData())
                   
  -    def documentAnnotations(self,document,annotatable):
  +    def documentAnnotations(self,xdocNode,annotatable):
           
           annotations=annotatable.getAnnotations()
           if not annotations: return        
           
  -        annotationsSection=document.createSection('Annotations')
  +        annotationsSection=xdocNode.createSection('Annotations')
  +        
  +        if annotatable.containsNasties():
  +            annotationsSection.createWarning('Some warnings and/ or errors are present')
  +        
           annotationsTable=annotationsSection.createTable()
           for note in annotations:      
               noteRow=annotationsTable.createRow()
  @@ -982,12 +1038,12 @@
               # when not string get the object link and <link it...
               noteRow.createData(note.text) 
                           
  -    def documentXML(self,document,xmlOwner):
  +    def documentXML(self,xdocNode,xmlOwner):
           
           xml=xmlOwner.xml
           if not xml: return        
           
  -        xmlSection=document.createSection('Definition')
  +        xmlSection=xdocNode.createSection('Definition')
           stream=StringIO.StringIO() 
           try:
               xmlize(xml.getTagName(),xml,stream)
  @@ -997,10 +1053,10 @@
           xmlSection.createSource(stream.read())
           stream.close()
               
  -    def documentSummary(self,document,summary,description='Project Summary'):
  +    def documentSummary(self,xdocNode,summary,description='Project Summary'):
           if not summary or not summary.projects: return
           
  -        summarySection=document.createSection(description)
  +        summarySection=xdocNode.createSection(description)
           summaryTable=summarySection.createTable(['Projects','Successes','Failures','Prereqs',
\
               'No Works','Packages'])
           
  @@ -1009,12 +1065,12 @@
                                   `summary.noworks`, `summary.packages`] )
           
         
  -    def documentWorkList(self,document,workable,description='Work'):
  +    def documentWorkList(self,xdocNode,workable,description='Work'):
           worklist=workable.getWorkList()
           
           if not worklist: return
           
  -        workSection=document.createSection(description)        
  +        workSection=xdocNode.createSection(description)        
           workTable=workSection.createTable(['Name','Type','State','Start','Elapsed'])
           
           for work in worklist:
  @@ -1025,7 +1081,7 @@
               workRow.createData(workTypeName(work.type)) 
               workRow.createData(stateName(work.state))
               workRow.createData(secsToDate(work.result.start_time))
  -            workRow.createData(secsToString(work.secs))
  +            workRow.createData(secsToElapsedString(work.getElapsedSecs()))
           
           #
           # Do a tail on all work that failed...
  @@ -1078,7 +1134,7 @@
                                   
               workList.createEntry("Start Time: ", secsToDate(work.result.start_time))
               workList.createEntry("End Time: ", secsToDate(work.result.end_time))
  -            workList.createEntry("Elapsed Time: ", secsToString(work.secs))
  +            workList.createEntry("Elapsed Time: ", secsToElapsedString(work.getElapsedSecs()))
                      
               #
               # Show parameters
  @@ -1327,7 +1383,7 @@
               if not gumpSet.inModules(module): continue
               elapsedRow=elapsedTable.createRow()
               self.insertLink( module, stats, elapsedRow.createData())
  -            elapsedRow.createData(elapsedTimeToString(module.elapsedTime()))
  +            elapsedRow.createData(secsToElapsedString(module.getElapsedSecs()))
               
           document.serialize()
       
  
  
  
  1.4       +4 -2      jakarta-gump/repository/apache-incubator-svn.xml
  
  Index: apache-incubator-svn.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/repository/apache-incubator-svn.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- apache-incubator-svn.xml	1 Dec 2003 22:39:52 -0000	1.3
  +++ apache-incubator-svn.xml	3 Dec 2003 18:36:13 -0000	1.4
  @@ -3,9 +3,11 @@
   <repository name="apache-incubator-svn" type="svn">
     <title>Apache Incubator SubVersion</title>
     <home-page>http://nagoya.apache.org/wiki/apachewiki.cgi?Subversion</home-page>
  -  <cvsweb>http://svn.apache.org/repos/test/incubator-directory/</cvsweb>
     
  -  <url>http://svn.apache.org/repos/test/incubator-directory/</url>
  +  <!-- Bogus, need to rename & just use url below -->
  +  <cvsweb>http://svn.apache.org/repos/asf/incubator/</cvsweb>  
  +  
  +  <url>http://svn.apache.org/repos/asf/incubator/</url>
     
     <redistributable/>
   </repository>
  
  
  

Mime
View raw message