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/python/gump/utils work.py
Date Tue, 02 Dec 2003 17:54:22 GMT
ajack       2003/12/02 09:54:22

  Modified:    python/gump/test tools.py
               python/gump/utils work.py
  Log:
  Fixed a 'work' bug.
  
  Revision  Changes    Path
  1.2       +9 -5      jakarta-gump/python/gump/test/tools.py
  
  Index: tools.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/test/tools.py,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- tools.py	2 Dec 2003 17:36:40 -0000	1.1
  +++ tools.py	2 Dec 2003 17:54:22 -0000	1.2
  @@ -64,7 +64,7 @@
   from gump.utils.tools import *
   from gump.test.pyunit import UnitTestSuite
   
  -class TestWork(Workable):
  +class TestWorkable(Workable):
       def __init__(self):    
           # Holds work (with state)
       	Workable.__init__(self)    
  @@ -74,14 +74,18 @@
           UnitTestSuite.__init__(self)
           
       def suiteSetUp(self):
  -        self.testwork=TestWork()
  +        self.testworkable=TestWorkable()
           
       def testListAsWork(self):
  -        listDirectoryAsWork(self.testwork,'.','test')
  +        listDirectoryAsWork(self.testworkable,'.','test')
       
       def testCatFileAsWork(self):
  -        catFileAsWork(self.testwork,'./text.xml','test')
  +        catFileAsWork(self.testworkable,'./text.xml','test')
           
       def testCatDirAsWork(self):
  -        catDirectoryContentsAsWork(self.testwork,'.','test')
  +        catDirectoryContentsAsWork(self.testworkable,'.','test')
  +        
  +    # :TODO: Move to work unit tests module (once written)
  +    def testWorkClone(self):
  +        self.testworkable.getWorkList().clone()
           
  
  
  
  1.3       +8 -1      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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- work.py	2 Dec 2003 17:36:40 -0000	1.2
  +++ work.py	2 Dec 2003 17:54:22 -0000	1.3
  @@ -168,12 +168,13 @@
           return self.result.tail(lines)
           
       def clone(self):
  -        return CommandWorkItem(self,type,self.command,self.result,self.message)
  +        return CommandWorkItem(self.type,self.command,self.result,self.message)
               
   class WorkList(list,Ownable):
       
       """List of work (in order)"""
       def __init__(self,owner=None):
  +        list.__init__(self)
           Ownable.__init__(self,owner)            
           
           # Organize by name
  @@ -224,6 +225,12 @@
           secs 	=	int(round(secs,0))        
       
           return (hours, mins, secs)
  +        
  +    def clone(self):
  +        cloned=WorkList()
  +        for item in self:
  +            cloned.add(item.clone())
  +        return cloned
           
   class Workable(Stateful):       
       def __init__(self):
  
  
  

Mime
View raw message