gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject cvs commit: gump/python/gump engine.py
Date Thu, 11 Mar 2004 16:13:51 GMT
ajack       2004/03/11 08:13:51

  Modified:    python/gump/utils work.py launcher.py tools.py sync.py
               python/gump/document forrest.py
               python/gump/model depend.py
               python/gump/net mailer.py
               python/gump engine.py
  Log:
  Minor tweaks (mainly documentation)
  
  Revision  Changes    Path
  1.11      +7 -7      gump/python/gump/utils/work.py
  
  Index: work.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/utils/work.py,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- work.py	9 Mar 2004 19:57:06 -0000	1.10
  +++ work.py	11 Mar 2004 16:13:50 -0000	1.11
  @@ -173,17 +173,17 @@
           self.command=command
           self.result=result
           
  -    def overview(self,lines=50):
  +    def overview(self,lines=50,wrapLen=0,eol=None,marker=None):
           overview=TimedWorkItem.overview(self)
           overview += self.command.overview()        
           if self.result:
               overview += "---------------------------------------------\n"             
  
  -            overview+=self.result.tail(lines)            
  +            overview+=self.result.tail(lines,wrapLen,eol,marker)            
               overview += "---------------------------------------------\n"
           return overview
           
  -    def tail(self,lines=50):
  -        return self.result.tail(lines)
  +    def tail(self,lines=50,wrapLen=0,eol=None,marker=None):
  +        return self.result.tail(lines,wrapLen,eol,marker)
           
       def clone(self):
           return CommandWorkItem(self.type,self.command,self.result,self.message)
  
  
  
  1.14      +5 -5      gump/python/gump/utils/launcher.py
  
  Index: launcher.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/utils/launcher.py,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- launcher.py	4 Mar 2004 17:26:09 -0000	1.13
  +++ launcher.py	11 Mar 2004 16:13:50 -0000	1.14
  @@ -296,10 +296,10 @@
           
           return overview
           
  -    def tail(self,lines):                
  +    def tail(self,lines,wrapLen=0,eol=None,marker=None):                
           if self.output:
               from gump.utils.tools import tailFileToString            
  -            tail = tailFileToString(self.output,lines)
  +            tail = tailFileToString(self.output,lines,wrapLen,eol,marker)
           else:
               tail = "No output\n"
               
  
  
  
  1.17      +19 -9     gump/python/gump/utils/tools.py
  
  Index: tools.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/utils/tools.py,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- tools.py	9 Mar 2004 19:57:06 -0000	1.16
  +++ tools.py	11 Mar 2004 16:13:50 -0000	1.17
  @@ -207,7 +207,7 @@
           if annotatable:
               transferAnnotations(sync, annotatable)    
       
  -def tailFile(file,lines):
  +def tailFile(file,lines,wrapLen=0,eol=None,marker=None):
       """ Return the last N lines of a file as a list """
       taillines=[]
       try:
  @@ -217,14 +217,24 @@
               o=open(file, 'r')
               line=o.readline()
               
  -            while line:
  +            size=0
  +            while line:      
  +                #
  +                # Wrap if requested
  +                #
  +                if wrapLen:
  +                    wline=wrapLine(line,eol,marker,wrapLen)
  +                else:
  +                    wline=line
  +                
                   # Store the lines
  -                taillines.append(line)
  +                taillines.append(wline)
               
                   # But dump any before 'lines'
  -                size=len(taillines)
  +                size+=len(wline)
                   if size > lines:
                       del taillines[0:(size-lines)]
  +                    size=len(taillines)
                       
                   # Read next...
                   line=o.readline()
  @@ -236,8 +246,8 @@
                               
       return taillines
   
  -def tailFileToString(file,lines):
  -    return "".join(tailFile(file,lines))
  +def tailFileToString(file,lines,wrapLen=0,eol=None,marker=None):
  +    return "".join(tailFile(file,lines,wrapLen,eol,marker))
       
   if __name__=='__main__':
   
  
  
  
  1.4       +5 -5      gump/python/gump/utils/sync.py
  
  Index: sync.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/utils/sync.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- sync.py	9 Mar 2004 19:57:06 -0000	1.3
  +++ sync.py	11 Mar 2004 16:13:50 -0000	1.4
  @@ -93,8 +93,8 @@
               action = 'copy'
           else:
               action = 'sync'
  -        log.info('Starting %s  from [%s]' % (action,self.sourcedir))
  -        log.info('        target dir [' + self.targetdir + ']')
  +        log.debug('Starting %s from [%s]' % (action,self.sourcedir))
  +        log.debug('          target dir [' + self.targetdir + ']')
           if not os.path.exists(self.sourcedir):
               log.error('Exiting sync, source directory does not exist [' + self.sourcedir
+ ']')
               raise IOError, 'source directory does not exist [' + self.sourcedir + ']'
  
  
  
  1.99      +28 -27    gump/python/gump/document/forrest.py
  
  Index: forrest.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/document/forrest.py,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  --- forrest.py	9 Mar 2004 20:31:02 -0000	1.98
  +++ forrest.py	11 Mar 2004 16:13:50 -0000	1.99
  @@ -114,8 +114,9 @@
           self.seedForrest(workspace)
          
           self.documentWorkspace(run,workspace,gumpSet)    
  -        self.documentStatistics(run,workspace,gumpSet)
  -        self.documentXRef(run,workspace,gumpSet)
  +        if gumpSet.isFull():
  +            self.documentStatistics(run,workspace,gumpSet)
  +            self.documentXRef(run,workspace,gumpSet)
   
           # Launch Forrest...
           self.executeForrest(workspace)
  @@ -976,17 +977,17 @@
           self.documentFileList(document,module,'Module-level Files')
           self.documentWorkList(document,module,'Module-level Work')
           
  -        addnSection=document.createSection('Additional Details')
  -        addnPara=addnSection.createParagraph()
  -        addnPara.createLink('index_details.html',	\
  -                            'More module details ...')
  -                                                                            
  -        document.serialize()
  -        
  -        document=XDocDocument('Module Details : ' + module.getName(),	\
  -                    self.resolver.getFile(module, \
  -                                    'index_details', \
  -                                        '.xml'))
  +        #addnSection=document.createSection('Additional Details')
  +        #addnPara=addnSection.createParagraph()
  +        #addnPara.createLink('index_details.html',	\
  +        #                    'More module details ...')
  +        #                                                                    
  +        #document.serialize()
  +        #
  +        #document=XDocDocument('Module Details : ' + module.getName(),	\
  +        #            self.resolver.getFile(module, \
  +        #                            'index_details', \
  +        #                                '.xml'))
               
           detailSection=document.createSection('Module Details')
           detailList=detailSection.createList()
  @@ -1160,16 +1161,16 @@
           self.documentFileList(document,project,'Project-level Files')  
           self.documentWorkList(document,project,'Project-level Work')  
                   
  -        addnSection=document.createSection('Additional Details')
  -        addnPara=addnSection.createParagraph()
  -        addnPara.createLink(gumpSafeName(project.getName()) + '_details.html',	\
  -                            'More project details ...')                               
                                         
  -        document.serialize()
  -        
  -        document=XDocDocument('Project Details : ' + project.getName(),	\
  -                    self.resolver.getFile(project, \
  -                                    project.getName() + '_details', \
  -                                        '.xml'))     
  +        #addnSection=document.createSection('Additional Details')
  +        #addnPara=addnSection.createParagraph()
  +        #addnPara.createLink(gumpSafeName(project.getName()) + '_details.html',	\
  +        #                    'More project details ...')                              
                                          
  +        #document.serialize()
  +        #
  +        #document=XDocDocument('Project Details : ' + project.getName(),	\
  +        #            self.resolver.getFile(project, \
  +        #                            project.getName() + '_details', \
  +        #                                '.xml'))     
    
       #    x.write('<p><strong>Project Config :</strong> <link href=\'%s\'>XML</link></p>'
\
       #                % (getModuleProjectRelativeUrl(modulename,project.name)) )       
             
  @@ -1487,7 +1488,7 @@
           for work in worklist:
               if isinstance(work,CommandWorkItem):      
                   if not STATE_SUCCESS == work.state:
  -                    tail=work.tail()
  +                    tail=work.tail(50,'...<br/>','    ',100)
                       if tail:
                           #
                           # Write out the 'tail'
  
  
  
  1.17      +5 -5      gump/python/gump/model/depend.py
  
  Index: depend.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/model/depend.py,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- depend.py	10 Mar 2004 20:28:36 -0000	1.16
  +++ depend.py	11 Mar 2004 16:13:50 -0000	1.17
  @@ -379,11 +379,11 @@
   
       # determine if this project is a prereq of any project on the todo list
       def hasDirectDependencyOn(self,project):
  -        for dependency in self.dependencies:
  +        for dependency in self.getDirectDependencies():
               if dependency.getProject()==project: return 1
       
       def hasDirectDependee(self,project):
  -        for dependee in self.dependees:
  +        for dependee in self.getDirectDependees():
               if dependee.getOwnerProject()==project: return 1
               
       def hasDependee(self,project):
  
  
  
  1.11      +4 -4      gump/python/gump/net/mailer.py
  
  Index: mailer.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/net/mailer.py,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- mailer.py	5 Mar 2004 08:31:32 -0000	1.10
  +++ mailer.py	11 Mar 2004 16:13:50 -0000	1.11
  @@ -141,7 +141,7 @@
           # Attach to the SMTP server to send....
           #
           server = smtplib.SMTP(server,port)
  -        server.set_debuglevel(1)
  +        #server.set_debuglevel(1)
           failures = server.sendmail(sane_fromaddr, sane_toaddrs, data)
           server.quit()
           
  
  
  
  1.81      +4 -1      gump/python/gump/engine.py
  
  Index: engine.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/engine.py,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- engine.py	9 Mar 2004 23:20:32 -0000	1.80
  +++ engine.py	11 Mar 2004 16:13:50 -0000	1.81
  @@ -440,10 +440,13 @@
                   log.debug(' ------ Building: [' + `projectNo` + '] ' + project.getName())
   
                   # Turn on --verbose or --debug if failing ...
  -                if not STATE_SUCCESS == stats.currentState:
  +                if (not STATE_SUCCESS == stats.currentState) and \
  +                        not project.isVerboseOrDebug():
                       if stats.sequenceInState > 5:
  +                        project.addInfo('Enable "debug" output, due to error.')
                           project.setDebug(1)
                       else:
  +                        project.addInfo('Enable "verbose" output, due to error.')    
                           project.setVerbose(1)
   
                   #
  
  
  

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


Mime
View raw message