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 2003/11/05 20:09:23 UTC

cvs commit: jakarta-gump/python/gump build.py logic.py statistics.py utils.py document.py conf.py

ajack       2003/11/05 11:09:23

  Modified:    template/forrest/src/documentation/content/xdocs site.xml
                        tabs.xml
               python/gump build.py logic.py statistics.py utils.py
                        document.py conf.py
  Log:
  1) Introduced buildLog/projects/project_todos/modules/module_todos
  2) Renamed orderedList to be OrderedList (to show it is a class)
  3) Allowed <mkdir to run, waiting on <delete
  4) Made 'not building XYZ 'cos not <ant/<script' a debug message.
  
  Revision  Changes    Path
  1.6       +3 -1      jakarta-gump/template/forrest/src/documentation/content/xdocs/site.xml
  
  Index: site.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/template/forrest/src/documentation/content/xdocs/site.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- site.xml	3 Nov 2003 19:42:44 -0000	1.5
  +++ site.xml	5 Nov 2003 19:09:22 -0000	1.6
  @@ -8,9 +8,11 @@
   
     <work label="Gump">
       <index label="Index" href="index.html"/>
  -    <index label="TODOs" href="todos.html"/>
  +    <index label="Log" href="buildLog.html"/>
       <index label="Modules" href="modules.html"/>
  +    <index label="Module TODOs" href="module_todos.html"/>
       <index label="Projects" href="projects.html"/>
  +    <index label="Project TODOs" href="project_todos.html"/>
       <index label="Packages" href="packages.html"/>
       <index label="Context" href="context.html"/>
     </work>
  
  
  
  1.3       +1 -1      jakarta-gump/template/forrest/src/documentation/content/xdocs/tabs.xml
  
  Index: tabs.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/template/forrest/src/documentation/content/xdocs/tabs.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- tabs.xml	30 Sep 2003 17:42:32 -0000	1.2
  +++ tabs.xml	5 Nov 2003 19:09:22 -0000	1.3
  @@ -15,6 +15,6 @@
   
     <tab id="home" label="Home" dir=""/>
     <tab id="stats" label="Statistics" dir="gump_stats"/>
  -  <tab id="xref" label="XRef" dir="gump_xref"/>
  +  <!-- tab id="xref" label="XRef" dir="gump_xref"/ -->
   
   </tabs>
  
  
  
  1.34      +10 -7     jakarta-gump/python/gump/build.py
  
  Index: build.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/build.py,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- build.py	4 Nov 2003 17:34:13 -0000	1.33
  +++ build.py	5 Nov 2003 19:09:22 -0000	1.34
  @@ -93,7 +93,7 @@
   # Functions
   ###############################################################################
   
  -def build(workspace, expr='*', context=GumpContext(), nosync=None):
  +def build(workspace, expr='*', context=GumpContext()):
     """ Build a expression of projects """
   
     projects=getProjectsForProjectExpression(expr)
  @@ -107,9 +107,9 @@
           print "  - " + p
       return 1
   
  -  return buildProjectList(workspace,projects,context,nosync)
  +  return buildProjectList(workspace,projects,context)
     
  -def buildProjectList(workspace, projects, context, nosync=None):
  +def buildProjectList(workspace, projects, context):
     """ Build a expression of projects """
           
     log.debug('Requests Projects')
  @@ -118,7 +118,7 @@
       
     sequence=getBuildSequenceForProjects(projects)
   
  -  return buildProjectSequence(workspace,sequence,context,nosync)
  +  return buildProjectSequence(workspace,sequence,context)
     
   def buildProjectSequence(workspace,sequence,context):
       
  @@ -286,6 +286,9 @@
     # get parsed workspace definition
     workspace=load(ws,context)
     
  +  module=Module.list.
  +  performPreBuild( workspace, context, mctxt, module, pctxt, project ):
  +    
     #
     # Perform build tasks
     #
  
  
  
  1.46      +6 -3      jakarta-gump/python/gump/logic.py
  
  Index: logic.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/logic.py,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- logic.py	4 Nov 2003 16:24:59 -0000	1.45
  +++ logic.py	5 Nov 2003 19:09:22 -0000	1.46
  @@ -247,7 +247,7 @@
       script=project.script
   
       if not (script or ant):
  -      log.info('   Not building ' + project.name + ' (no <ant/> or <script/> specified)')
  +      log.debug('Not building ' + project.name + ' (no <ant/> or <script/> specified)')
         return None
   
       if script and script.name:
  @@ -394,6 +394,10 @@
       #
       # Delete a directory and/or a file
       #
  +    # :TODO: Before turning this on, we need to ensure that the command
  +    # will not run wild. We need to ensure that there is no ";" and we
  +    # need to ensure the directory/file is under the workspace.
  +    #
       if delete.dir:
           cmd.addParameter('-rf')  
           cmd.addParameter(os.path.abspath(os.path.join(basedir,delete.dir)))
  @@ -409,14 +413,13 @@
   def getMkDirCommand(workspace,context,module,project,mkdir,index=0):
       basedir=os.path.abspath(module.srcdir or dir.base)
         
  -    cmd=Cmd('echo mkdir','mkdir_'+module.name+'_'+project.name+'_'+str(index+1),\
  +    cmd=Cmd('mkdir','mkdir_'+module.name+'_'+project.name+'_'+str(index+1),\
               basedir)
   
       #
       # Make a directory
       #
       if mkdir.dir:
  -        cmd.addParameter('-rf')  
           cmd.addParameter(os.path.abspath(os.path.join(basedir,mkdir.dir)))
       else:
           log.info('   <mkdir without \'dir\' attribute.')
  
  
  
  1.6       +5 -5      jakarta-gump/python/gump/statistics.py
  
  Index: statistics.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/statistics.py,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- statistics.py	29 Oct 2003 18:36:31 -0000	1.5
  +++ statistics.py	5 Nov 2003 19:09:22 -0000	1.6
  @@ -334,11 +334,11 @@
           
           self.wguru=WorkspaceStatisticsGuru(workspace)
                   
  -        self.modulesByElapsed=orderedList(context.subcontexts.values(),sortByElapsed)
  -        self.modulesByProjectCount=orderedList(context.subcontexts.values(),sortByProjectCount)
  -        self.modulesByTotalDependencies=orderedList(context.subcontexts.values(),sortByDependencyCount)
  -        self.modulesByTotalDependees=orderedList(context.subcontexts.values(),sortByDependeeCount)
  -        self.modulesByFOGFactor=orderedList(context.subcontexts.values(),sortByFOGFactor)
  +        self.modulesByElapsed=OrderedList(context.subcontexts.values(),sortByElapsed)
  +        self.modulesByProjectCount=OrderedList(context.subcontexts.values(),sortByProjectCount)
  +        self.modulesByTotalDependencies=OrderedList(context.subcontexts.values(),sortByDependencyCount)
  +        self.modulesByTotalDependees=OrderedList(context.subcontexts.values(),sortByDependeeCount)
  +        self.modulesByFOGFactor=OrderedList(context.subcontexts.values(),sortByFOGFactor)
      
           
   #        calculate()
  
  
  
  1.9       +10 -2     jakarta-gump/python/gump/utils.py
  
  Index: utils.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/utils.py,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- utils.py	23 Oct 2003 19:38:16 -0000	1.8
  +++ utils.py	5 Nov 2003 19:09:22 -0000	1.9
  @@ -154,12 +154,20 @@
           key=self.iter.next()
           return self.dict[key]      
           
  -def orderedList(list,sortfunc):
  +def OrderedList(list,sortfunc=None):
       # Is there a better way to clone a list?    
       sorted=[]
  +    
  +    # Populate the list
       for value in list:
           sorted.append(value)
  -    sorted.sort(sortfunc)
  +        
  +    # Sort it
  +    if sortfunc:
  +        sorted.sort(sortfunc)
  +    else:
  +        sorted.sort()
  +        
       return sorted   
     
   def printSeparator(indent=''):
  
  
  
  1.108     +119 -40   jakarta-gump/python/gump/document.py
  
  Index: document.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/document.py,v
  retrieving revision 1.107
  retrieving revision 1.108
  diff -u -r1.107 -r1.108
  --- document.py	5 Nov 2003 06:20:09 -0000	1.107
  +++ document.py	5 Nov 2003 19:09:22 -0000	1.108
  @@ -247,6 +247,9 @@
   #      
   def documentWorkspace(workspace,context,db,moduleList,projectList):
       
  +    sortedModuleList=OrderedList(moduleList)
  +    sortedProjectList=OrderedList(projectList)
  +    
       wdir=getWorkspaceDir(workspace)
       
       #
  @@ -330,13 +333,125 @@
           
       footerXDoc(x)
       endXDoc(x)
  + 
  +    #
  +    # ----------------------------------------------------------------------
  +    #
  +    # buildLog.xml -- Projects in build order
  +    #
  +    x=startXDoc(getWorkspaceDocument(workspace,wdir,'buildLog'))      
  +    headerXDoc(x,'Project Build Log')
  +    
  +    documentSummary(x,context.getProjectSummary())
  +    
  +    startSectionXDoc(x,'Project in Build Order')
  +    startTableXDoc(x)
  +    x.write('     <tr>')        
  +    x.write('      <th>Name</th><th>Project State</th><th>Elapsed Time</th>')
  +    x.write('     </tr>')
  +    pcount=0
  +    for project in projectList:
  +        pctxt=context.getProjectContextForProject(project)
  +        pname=pctxt.name
  +        pcount+=1
  +
  +        x.write('     <tr><!-- %s -->\n' % (pname))        
  +        x.write('      <td><link href=\'%s\'>%s</link></td><td>%s</td>\n' % \
  +                      (	getModuleProjectRelativeUrl(pctxt.parent.name, pname),	\
  +                        pname,	\
  +                        getStateIcon(pctxt)))    
  +        x.write('      <td>%s</td>\n' % elapsedTimeToString(pctxt.elapsedTime()))    
  +        x.write('     </tr>\n\n')
  +            
  +    if not pcount: x.write('	<tr><td>None</td></tr>')
  +    endTableXDoc(x)
  +    endSectionXDoc(x)    
  +
  +    footerXDoc(x)
  +    endXDoc(x)
  +       
  +    #
  +    # ----------------------------------------------------------------------
  +    #
  +    # projects.xml -- Projects in build order
  +    #
  +    x=startXDoc(getWorkspaceDocument(workspace,wdir,'projects'))      
  +    headerXDoc(x,'All Projects')
  +    
  +    documentSummary(x,context.getProjectSummary())
  +    
  +    startSectionXDoc(x,'Project in Build Order')
  +    startTableXDoc(x)
  +    x.write('     <tr>')        
  +    x.write('      <th>Name</th><th>Project State</th><th>Elapsed Time</th>')
  +    x.write('     </tr>')
  +    pcount=0
  +    for project in sortedProjectList:
  +        pctxt=context.getProjectContextForProject(project)
  +        pname=pctxt.name
  +        pcount+=1
  +
  +        x.write('     <tr><!-- %s -->\n' % (pname))        
  +        x.write('      <td><link href=\'%s\'>%s</link></td><td>%s</td>\n' % \
  +                      (	getModuleProjectRelativeUrl(pctxt.parent.name, pname),	\
  +                        pname,	\
  +                        getStateIcon(pctxt)))    
  +        x.write('      <td>%s</td>\n' % elapsedTimeToString(pctxt.elapsedTime()))    
  +        x.write('     </tr>\n\n')
  +            
  +    if not pcount: x.write('	<tr><td>None</td></tr>')
  +    endTableXDoc(x)
  +    endSectionXDoc(x)    
  +
  +    footerXDoc(x)
  +    endXDoc(x)
  +       
  +    #
  +    # ----------------------------------------------------------------------
  +    #
  +    # project_todoss.xml -- Projects w/ issues in build order
  +    #
  +    x=startXDoc(getWorkspaceDocument(workspace,wdir,'project_todos'))      
  +    headerXDoc(x,'All Projects')
       
  +    documentSummary(x,context.getProjectSummary())
  +    
  +    startSectionXDoc(x,'Project in Build Order')
  +    startTableXDoc(x)
  +    x.write('     <tr>')        
  +    x.write('      <th>Name</th><th>Project State</th><th>Elapsed Time</th>')
  +    x.write('     </tr>')
  +    pcount=0
  +    for project in sortedProjectList:
  +        pctxt=context.getProjectContextForProject(project)
  +        pname=pctxt.name
  +        
  +        if not pctxt.status==STATUS_FAILED:
  +            continue
  +            
  +        pcount+=1
  +
  +        x.write('     <tr><!-- %s -->\n' % (pname))        
  +        x.write('      <td><link href=\'%s\'>%s</link></td><td>%s</td>\n' % \
  +                      (	getModuleProjectRelativeUrl(pctxt.parent.name, pname),	\
  +                        pname,	\
  +                        getStateIcon(pctxt)))    
  +        x.write('      <td>%s</td>\n' % elapsedTimeToString(pctxt.elapsedTime()))    
  +        x.write('     </tr>\n\n')
  +            
  +    if not pcount: x.write('	<tr><td>None</td></tr>')
  +    endTableXDoc(x)
  +    endSectionXDoc(x)    
  +
  +    footerXDoc(x)
  +    endXDoc(x)
  +       
       #
       # ----------------------------------------------------------------------
       #
  -    # TODOs.xml
  +    # module_todos.xml
       #
  -    x=startXDoc(getWorkspaceDocument(workspace,wdir,'todos'))    
  +    x=startXDoc(getWorkspaceDocument(workspace,wdir,'module_todos'))    
       headerXDoc(x,'Modules with TODOs')    
       
       documentSummary(x,context.getProjectSummary())
  @@ -445,42 +560,6 @@
       #
       # ----------------------------------------------------------------------
       #
  -    # Projects.xml
  -    #
  -    x=startXDoc(getWorkspaceDocument(workspace,wdir,'projects'))      
  -    headerXDoc(x,'All Projects')
  -    
  -    documentSummary(x,context.getProjectSummary())
  -    
  -    startSectionXDoc(x,'All Project')
  -    startTableXDoc(x)
  -    x.write('     <tr>')        
  -    x.write('      <th>Name</th><th>Project State</th><th>Elapsed Time</th>')
  -    x.write('     </tr>')
  -    pcount=0
  -    for project in projectList:
  -        pctxt=context.getProjectContextForProject(project)
  -        pname=pctxt.name
  -        pcount+=1
  -
  -        x.write('     <tr><!-- %s -->\n' % (pname))        
  -        x.write('      <td><link href=\'%s\'>%s</link></td><td>%s</td>\n' % \
  -                      (	getModuleProjectRelativeUrl(pctxt.parent.name, pname),	\
  -                        pname,	\
  -                        getStateIcon(pctxt)))    
  -        x.write('      <td>%s</td>\n' % elapsedTimeToString(pctxt.elapsedTime()))    
  -        x.write('     </tr>\n\n')
  -            
  -    if not pcount: x.write('	<tr><td>None</td></tr>')
  -    endTableXDoc(x)
  -    endSectionXDoc(x)    
  -
  -    footerXDoc(x)
  -    endXDoc(x)
  -    
  -    #
  -    # ----------------------------------------------------------------------
  -    #
       # Packages.xml
       #
       x=startXDoc(getWorkspaceDocument(workspace,wdir,'packages'))     
  @@ -916,7 +995,7 @@
       for work in worklist:
           documentWork(workspace,workcontext,work,dir)
           
  -def documentWork(workspace,workcontext,work,dir):
  +def documentWork(workspace,workcontext,work,dir,depth=2):
       if isinstance(work,CommandWorkItem):    
           x=startXDoc(getWorkDocument(dir,work.command.name,work.type))
           headerXDoc(x, workTypeName(work.type) + ' : ' + work.command.name)
  @@ -924,7 +1003,7 @@
           
           startListXDoc(x) 
           addItemXDoc(x,"Status: ", stateName(work.status))
  -        addXItemXDoc(x,"For: ", getTypedContextLink(workcontext))
  +        addXItemXDoc(x,"For: ", getTypedContextLink(workcontext,depth))
           # addItemXDoc(x,"Command: ", work.command.name)
           if work.command.cwd:
               addItemXDoc(x,"Working Directory: ", work.command.cwd)
  
  
  
  1.37      +5 -5      jakarta-gump/python/gump/conf.py
  
  Index: conf.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/conf.py,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- conf.py	4 Nov 2003 16:15:03 -0000	1.36
  +++ conf.py	5 Nov 2003 19:09:22 -0000	1.37
  @@ -111,9 +111,9 @@
   class setting:    
       """Configuration of hardcoded settings"""
       
  -    version="2.0.1-alpha-0007"
  +    version="2.0.1-alpha-0008"
       
  -    # :TODO: Add "minimum checks later..."
  +    # :TODO: Add "minimum version" checks...
       ws_version="0.4"
       
       datetimeformat="%a, %d %b %Y %H:%M:%S (%Z)"