ajack       2004/04/22 15:58:17

  Modified:    python/gump/utils work.py launcher.py sync.py
               .        gumpy.py
               python/gump update.py debug.py
               python/gump/test sync.py resolving.py unicode.py thomas.py
                        nagging.py
               python/gump/core gumprun.py gumpinit.py engine.py
               python/gump/model module.py workspace.py propagation.py
               python/gump/document/forrest documenter.py resolver.py
               python/gump/shared comparator.py
               python/gump/output statsdb.py
  Log:
  Listened to comitCheck.py/pychecker.py
  
  Revision  Changes    Path
  1.15      +1 -13     gump/python/gump/utils/work.py
  
  Index: work.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/utils/work.py,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- work.py   12 Apr 2004 18:57:36 -0000      1.14
  +++ work.py   22 Apr 2004 22:58:15 -0000      1.15
  @@ -100,16 +100,10 @@
           if self.hasTimes():
               return int(round(self.endSecs-self.startSecs,0))
           return 0
  -        
  -    def getElapsedTimeString(self):   
  -        return secsToElapsedTimeString(self.getElapsedSecs())
  -        
  -    def getElapsedTimeTriple(self):   
  -        return secsToElapsedTimeTriple(self.getElapsedSecs())
            
       def overview(self):
           overview=WorkItem.overview(self)
  -        (hours,mins,secs)=self.getElapsedTimeTriple()
  +        (hours,mins,secs)=secsToElapsedTimeTriple(self.getElapsedSecs())
           overview+='Elapsed: '
           overview+=str(hours) + ' hours, ' 
           overview+=str(mins) + ' minutes, ' 
  @@ -201,9 +195,6 @@
               if isinstance(item,TimedWorkItem): 
                   elapsedSecs += item.getElapsedSecs()
           return elapsedSecs
  -    
  -    def getElapsedTime(self):   
  -        return secsToElapsedTime(self.getElapsedSecs())
                   
       def clone(self):
           cloned=WorkList()
  @@ -233,7 +224,4 @@
                  
       def getElapsedSecs(self):
           return self.worklist.getElapsedSecs()
  -    
  -    def getElapsedTime(self):   
  -        return self.worklist.getElapsedTime()
       
  
  
  
  1.21      +1 -1      gump/python/gump/utils/launcher.py
  
  Index: launcher.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/utils/launcher.py,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- launcher.py       16 Apr 2004 17:28:37 -0000      1.20
  +++ launcher.py       22 Apr 2004 22:58:15 -0000      1.21
  @@ -244,7 +244,7 @@
           if self.output:
             overview += indent+"Output: " + self.output
           if self.hasTimes():
  -          overview += indent+"Elapsed: " + self.getElapsedTimeString()
  +          overview += indent+"Elapsed: " + 
secsToElapsedTimeString(self.getElapsedSecs())
           if self.signal:
             overview += indent+"Termination Signal: " + str(self.signal)
           if self.exit_code:
  
  
  
  1.10      +3 -0      gump/python/gump/utils/sync.py
  
  Index: sync.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/utils/sync.py,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- sync.py   22 Apr 2004 18:24:33 -0000      1.9
  +++ sync.py   22 Apr 2004 22:58:15 -0000      1.10
  @@ -77,6 +77,9 @@
               
       def copytree(self, src, dst, symlinks=0):
           
  +        # Only supported on some platforms.
  +        if 'posix'<>os.name: symlinks=0
  +        
           #
           # List all the files in the source location
           #
  
  
  
  1.23      +1 -1      gump/gumpy.py
  
  Index: gumpy.py
  ===================================================================
  RCS file: /home/cvs/gump/gumpy.py,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- gumpy.py  22 Apr 2004 14:50:47 -0000      1.22
  +++ gumpy.py  22 Apr 2004 22:58:15 -0000      1.23
  @@ -261,7 +261,7 @@
           basePath=os.path.abspath(baseDir)

           # Mail reporting

           private=wsw.getAttribute('private')

  -        mailserver=wsw.getAttribute('mailserver')

  +        mailserver=wsw.getAttribute('mailserver') or 'mail.apache.org'

           mailport=wsw.getAttribute('mailport') or 25

           mailto=wsw.getAttribute('mailinglist') or '[EMAIL PROTECTED]'  

           mailfrom=wsw.getAttribute('email') or '[EMAIL PROTECTED]'  

  
  
  
  1.27      +2 -2      gump/python/gump/update.py
  
  Index: update.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/update.py,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- update.py 16 Apr 2004 17:28:38 -0000      1.26
  +++ update.py 22 Apr 2004 22:58:15 -0000      1.27
  @@ -34,7 +34,7 @@
   from gump.core.gumpinit import gumpinit
   from gump.core.engine import GumpEngine
   from gump.core.gumprun import GumpRun, GumpRunOptions, GumpSet
  -from gump.core.utils.commandLine import handleArgv
  +from gump.core.commandLine import handleArgv
   from gump.model.loader import WorkspaceLoader
   
   
  
  
  
  1.5       +1 -1      gump/python/gump/debug.py
  
  Index: debug.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/debug.py,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- debug.py  16 Apr 2004 17:28:38 -0000      1.4
  +++ debug.py  22 Apr 2004 22:58:15 -0000      1.5
  @@ -30,7 +30,7 @@
   from gump.core.gumpinit import gumpinit
   from gump.core.engine import GumpEngine
   from gump.core.gumprun import GumpRun, GumpRunOptions, GumpSet
  -from gump.core.utils.commandLine import handleArgv
  +from gump.core.commandLine import handleArgv
   from gump.model.loader import WorkspaceLoader
   
   
  
  
  
  1.4       +7 -5      gump/python/gump/test/sync.py
  
  Index: sync.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/test/sync.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- sync.py   2 Apr 2004 16:48:06 -0000       1.3
  +++ sync.py   22 Apr 2004 22:58:15 -0000      1.4
  @@ -17,7 +17,7 @@
       Sync Testing
   """
   
  -from gump.utils.sync import Sync
  +from gump.utils.sync import Sync,Copy
   from gump.test.pyunit import UnitTestSuite
   from gump import log
   import os.path
  @@ -55,6 +55,7 @@
           if os.path.exists(self.destination):
               log.debug('attempting to remove directory [%s]' % (`self.destination`))
               shutil.rmtree(self.destination)    
  +            
       def testSimpleSync(self):
           """
           assuming the setUp gets done,
  @@ -211,6 +212,7 @@
               self.raiseIssue(['destination text file remained a file',
                self.destination_alphatxt])
           self.genericCompare(self.source_alphatxt, self.destination_alphatxt)
  +        
       def testSymbolicLink(self):
           """
           this test only runs on operating systems where os.name will return
  @@ -227,6 +229,7 @@
               mySync = Sync(self.source, self.destination)
               mySync.execute()
               self.genericCompare(self.source, self.destination)
  +            
       def testCopy1(self):
           """
           the setUp gets done
  @@ -251,8 +254,8 @@
           sometime=[2000,5,20,12,7,40,5,141,-1]
           epoch_sometime = time.mktime(sometime)
           os.utime(source_betatxt, (epoch_sometime, epoch_sometime))
  -        mySync = Sync(self.source, self.destination, 1)
  -        mySync.execute()
  +        myCopy = Copy(self.source, self.destination)
  +        myCopy.execute()
           # check that alpha.txt was preserved on the destination side
           if not os.path.exists(self.destination_alphatxt):
               self.raiseIssue(['file was deleted on the destination side in a copy'
  @@ -282,8 +285,7 @@
                   self.assertTrue([inode_dest, ' points to ', linkto_source ],
                   linkto_source==linkto_dest)
               elif os.path.isdir(inode_source):
  -                self.genericCompare(inode_source, inode_dest)    
  -                            
  +                self.genericCompare(inode_source, inode_dest)                       
         
                       
       def compareFiles(self, inode_source, inode_dest):
           """
  
  
  
  1.6       +1 -2      gump/python/gump/test/resolving.py
  
  Index: resolving.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/test/resolving.py,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- resolving.py      16 Apr 2004 17:28:35 -0000      1.5
  +++ resolving.py      22 Apr 2004 22:58:15 -0000      1.6
  @@ -124,8 +124,7 @@
                               TemplateResolver('./test','http://somewhere/something') 
] :
   
   
  -            print `resolver`
  -            
  +            #print `resolver`            
               #printSeparator()
               
               message = "Resolver [" + resolver.__class__.__name__ + "] "
  
  
  
  1.4       +1 -1      gump/python/gump/test/unicode.py
  
  Index: unicode.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/test/unicode.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- unicode.py        2 Apr 2004 16:48:06 -0000       1.3
  +++ unicode.py        22 Apr 2004 22:58:15 -0000      1.4
  @@ -52,7 +52,7 @@
               i+=1
           edata=data.translate(self.maps)
           xmld='<xml>'+escape(edata)+'</xml>'     
  -        print xmld   
  +        #print xmld   
           dom=xml.dom.minidom.parseString(xmld)
       
           
  
  
  
  1.3       +3 -3      gump/python/gump/test/thomas.py
  
  Index: thomas.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/test/thomas.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- thomas.py 16 Apr 2004 17:28:35 -0000      1.2
  +++ thomas.py 22 Apr 2004 22:58:15 -0000      1.3
  @@ -36,16 +36,16 @@
           engine=GumpEngine()
           taskList=GumpTaskList(['build'])
           taskList.bind(engine)
  -        print `taskList`
  +        #print `taskList`
               
       def testBuildDocumentTasks(self):
           engine=GumpEngine()    
           taskList=GumpTaskList(['build','document'])
           taskList.bind(engine)
  -        print `taskList`
  +        #print `taskList`
               
       def testUpdateBuildStatsTasks(self):
           engine=GumpEngine()    
           taskList=GumpTaskList(['update','build','updateStatistics'])
           taskList.bind(engine)
  -        print `taskList`
  \ No newline at end of file
  +        #print `taskList`
  \ No newline at end of file
  
  
  
  1.11      +2 -1      gump/python/gump/test/nagging.py
  
  Index: nagging.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/test/nagging.py,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- nagging.py        16 Apr 2004 17:28:35 -0000      1.10
  +++ nagging.py        22 Apr 2004 22:58:15 -0000      1.11
  @@ -51,7 +51,8 @@
               nagger.getNamedTypedContent(module,'test')
               for project in module.getProjects():
                   #print 'Get Content For Project : ' + project.getName()
  -                print nagger.getNamedTypedContent(project,'test')
  +                # print 
  +                nagger.getNamedTypedContent(project,'test')
                   
       def testNagUnwantedUnsent(self):
       
  
  
  
  1.2       +5 -0      gump/python/gump/core/gumprun.py
  
  Index: gumprun.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/core/gumprun.py,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- gumprun.py        16 Apr 2004 17:28:41 -0000      1.1
  +++ gumprun.py        22 Apr 2004 22:58:16 -0000      1.2
  @@ -427,6 +427,11 @@
           
   class GumpRun(Workable,Annotatable,Stateful):
       def __init__(self,workspace,expr=None,options=None,env=None):
  +        
  +        Workable.__init__(self)
  +        Annotatable.__init__(self)
  +        Stateful.__init__(self)
  +        
           #
           # The workspace being worked upon
           #
  
  
  
  1.2       +1 -4      gump/python/gump/core/gumpinit.py
  
  Index: gumpinit.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/core/gumpinit.py,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- gumpinit.py       16 Apr 2004 17:28:41 -0000      1.1
  +++ gumpinit.py       22 Apr 2004 22:58:16 -0000      1.2
  @@ -26,9 +26,6 @@
   import sys
   import time
   
  -# Either python-2.3 or http://www.red-dove.com/python_logging.html
  -import logging
  -
   # tell Python what modules make up the gump package
   # __all__ = ["config"]
   
  
  
  
  1.3       +2 -1      gump/python/gump/core/engine.py
  
  Index: engine.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/core/engine.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- engine.py 22 Apr 2004 21:14:02 -0000      1.2
  +++ engine.py 22 Apr 2004 22:58:16 -0000      1.3
  @@ -600,7 +600,8 @@
                                   project.addError(message)
                                   log.error(message)                     
                       elif project.isRedistributable():
  -                        # :TODO: restore to warning
  +                        # :TODO: restore to warning. made info so
  +                        # annotation page was useful (and not overloaded).
                           project.addInfo('No license on redistributable project with 
outputs.')                                        
                                       
                   if outputsOk: 
  
  
  
  1.42      +1 -12     gump/python/gump/model/module.py
  
  Index: module.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/model/module.py,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- module.py 13 Apr 2004 15:59:24 -0000      1.41
  +++ module.py 22 Apr 2004 22:58:16 -0000      1.42
  @@ -475,18 +475,7 @@
                   if cause == self or cause in self.getProjects():
                       self.affected += 1            
           
  -        return self.affected
  -                   
  -    def getProjectStatistics(self,db=None):
  -        if not hasattr(self,'stats'):
  -            # Load the DB, if not loaded
  -            if not db:
  -                db=StatisticsDB()
  -            # Extract from project statistics DB
  -            stats=db.getProjectStats(pctxt.name)
  -            self.stats=stats
  -            
  -        return self.stats                
  +        return self.affected    
       
       def dump(self, indent=0, output=sys.stdout):
           output.write(getIndent(indent)+'Module : ' + self.name + '\n')
  
  
  
  1.47      +1 -1      gump/python/gump/model/workspace.py
  
  Index: workspace.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/model/workspace.py,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- workspace.py      16 Apr 2004 17:28:41 -0000      1.46
  +++ workspace.py      22 Apr 2004 22:58:16 -0000      1.47
  @@ -546,7 +546,7 @@
           
       def dump(self, indent=0, output=sys.stdout):
           output.write('Workspace : \n')
  -        ModelObject.dump(self, indent+1, output)
  +        NamedModelObject.dump(self, indent+1, output)
           
           for profile in self.profiles.values():
               profile.dump(indent+1,output)
  
  
  
  1.3       +6 -2      gump/python/gump/model/propagation.py
  
  Index: propagation.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/model/propagation.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- propagation.py    31 Mar 2004 17:41:41 -0000      1.2
  +++ propagation.py    22 Apr 2004 22:58:16 -0000      1.3
  @@ -21,10 +21,13 @@
   from string import lower, capitalize
   
   from gump.model.state import *
  +from gump.utils.work import *
   
   class Propogatable(Stateful):
       
       def __init__(self):     
  +        Stateful.__init__(self)
  +        
           # Problems        
           self.cause=None      # Primary Cause
           self.causes=[]
  @@ -57,8 +60,9 @@
                   if not message:
                       message = lower(stateDescription(state))
                       if not REASON_UNSET == reason:
  -                        message += " with reason " + 
lower(reasonDescription(reason))            
  -                self.addInfo(capitalize(message))
  +                        message += " with reason " + 
lower(reasonDescription(reason))   
  +                if isinstance(self,Workable):
  +                    self.addInfo(capitalize(message))
           
                   # Send on the changes...
                   self.propagateErrorStateChange(state,reason,cause,message)
  
  
  
  1.16      +6 -1      gump/python/gump/document/forrest/documenter.py
  
  Index: documenter.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/document/forrest/documenter.py,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- documenter.py     22 Apr 2004 20:52:12 -0000      1.15
  +++ documenter.py     22 Apr 2004 22:58:16 -0000      1.16
  @@ -49,6 +49,8 @@
   from gump.output.xref import XRefGuru
   from gump.core.gumprun import *
   
  +from gump.shared.comparator import *
  +
   def getUpUrl(depth):
       url=''
       i = 0
  @@ -742,7 +744,10 @@
                       'Dependees',     \
                       'Duration\nin state','Project State'])
           pcount=0
  -        for project in sortedProjectList:
  +        
  +        affectedOrder=createOrderedList(sortedProjectList,compareProjectsByAffected)
  +  
  +        for project in affectedOrder:
               if not gumpSet.inProjectSequence(project): continue       
               
               if not project.getState()==STATE_FAILED:
  
  
  
  1.7       +0 -2      gump/python/gump/document/forrest/resolver.py
  
  Index: resolver.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/document/forrest/resolver.py,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- resolver.py       22 Apr 2004 19:58:08 -0000      1.6
  +++ resolver.py       22 Apr 2004 22:58:16 -0000      1.7
  @@ -18,11 +18,9 @@
       Resolving URLs/Files.
   """
   
  -import socket
   import time
   import os
   import sys
  -import logging
   from xml.sax.saxutils import escape
   from string import lower,replace
   
  
  
  
  1.3       +9 -3      gump/python/gump/shared/comparator.py
  
  Index: comparator.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/shared/comparator.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- comparator.py     22 Apr 2004 18:24:36 -0000      1.2
  +++ comparator.py     22 Apr 2004 22:58:17 -0000      1.3
  @@ -122,12 +122,18 @@
       c= int(round(dep2 - dep1,0))                  
       if not c: c=cmp(project1,project2)
       return c                         
  -                               
  -                        
  +                            
   def compareProjectsByTotalDependencyDepth(project1,project2):
       tot1=project1.getTotalDependencyDepth()
       tot2=project2.getTotalDependencyDepth()
       c= int(round(tot2 - tot1,0))                  
  +    if not c: c=cmp(project1,project2)
  +    return c                         
  +                            
  +def compareProjectsByAffected(project1,project2):
  +    aff1=project1.determineAffected()
  +    aff2=project2.determineAffected()
  +    c= int(round(aff2 - aff1,0))                  
       if not c: c=cmp(project1,project2)
       return c                         
               
  
  
  
  1.24      +1 -1      gump/python/gump/output/statsdb.py
  
  Index: statsdb.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/output/statsdb.py,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- statsdb.py        22 Apr 2004 18:24:36 -0000      1.23
  +++ statsdb.py        22 Apr 2004 22:58:17 -0000      1.24
  @@ -197,7 +197,7 @@
           # Hack to patch values incorrectly set to 0
           # not -1 by default.
           if 0 == dateF:
  -            dateF == -1
  +            dateF = -1
               
           return dateF
           
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to