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/model object.py
Date Tue, 29 Jun 2004 19:30:43 GMT
ajack       2004/06/29 12:30:43

  Modified:    python/gump/runner Tag: CleanUp tasks.py runner.py demand.py
               python/gump/test Tag: CleanUp pyunit.py
               python/gump/update Tag: CleanUp cvs.py svn.py
               python/gump/document/xdocs Tag: CleanUp documenter.py
               python/gump/model Tag: CleanUp object.py
  Added:       python/gump/performance Tag: CleanUp deps.py
               python/gump/test Tag: CleanUp threads.py
               python/gump/threads Tag: CleanUp tools.py __init__.py
                        .cvsignore
  Removed:     python/gump Tag: CleanUp logconf.ini
  Log:
  Tinkering w/ threads...
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.4.2.2   +51 -0     gump/python/gump/runner/tasks.py
  
  Index: tasks.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/runner/tasks.py,v
  retrieving revision 1.4.2.1
  retrieving revision 1.4.2.2
  diff -u -r1.4.2.1 -r1.4.2.2
  --- tasks.py	14 Jun 2004 21:31:45 -0000	1.4.2.1
  +++ tasks.py	29 Jun 2004 19:30:41 -0000	1.4.2.2
  @@ -19,6 +19,57 @@
   
   """
   
  +
  +
  +
  +
  +
  +        # OBSOLETE MODULE LEFT HERE FOR SPARE PARTS
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
   import os.path
   import sys
   
  
  
  
  1.5.2.6   +1 -2      gump/python/gump/runner/runner.py
  
  Index: runner.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/runner/runner.py,v
  retrieving revision 1.5.2.5
  retrieving revision 1.5.2.6
  diff -u -r1.5.2.5 -r1.5.2.6
  --- runner.py	18 Jun 2004 14:58:16 -0000	1.5.2.5
  +++ runner.py	29 Jun 2004 19:30:41 -0000	1.5.2.6
  @@ -54,7 +54,7 @@
           self.updater=GumpUpdater(run)
           self.builder=GumpBuilder(run)
           
  -    def initialize(self,exitOnError=1):
  +    def initialize(self,exitOnError=True):
           
           logResourceUtilization('Before initialize')
           
  @@ -143,7 +143,6 @@
           
       def getBuilder(self):
           return self.builder
  -        
           
       #
       # Call a method called 'documentRun(run)'
  
  
  
  1.3.2.2   +68 -6     gump/python/gump/runner/demand.py
  
  Index: demand.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/runner/demand.py,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- demand.py	17 Jun 2004 02:35:44 -0000	1.3.2.1
  +++ demand.py	29 Jun 2004 19:30:41 -0000	1.3.2.2
  @@ -41,36 +41,96 @@
   from gump.model.stats import *
   from gump.model.state import *
   
  +from gump.threads.tools import *
  +
   
   ###############################################################################
   # Classes
   ###############################################################################
  -
  +  
  +class UpdateWork:
  +    def __init__(self,runner,module):
  +        self.runner=runner
  +        self.module=module
  +        
  +    def __str__(self):
  +        return 'UpdateWork:'+`self.module`
  +        
  +class UpdateWorker(WorkerThread):
  +    def performWork(self,work):
  +        # Do the work...
  +        work.runner.performUpdate(work.module)
  +        
   class OnDemandRunner(GumpRunner):
   
       def __init__(self,run):
           GumpRunner.__init__(self,run)
   
       ###########################################
  +    def spawnUpdateThreads(self):
  +        
  +        self.workList=ThreadWorkList('Updates')
  +        for module in self.run.gumpSet.getModuleSequence():
  +            self.workList.addWork(UpdateWork(self,module))    
  +            
  +        # Create a group of workers...
  +        self.group=WorkerThreadGroup('Update',5,self.workList,UpdateWorker)
  +        self.group.start()
  +        
  +    def waitForThreads(self):
  +        self.group.waitForAll()
  +        
  +    def performUpdate(self,module):
  +        """
  +        	Perform
  + 	
  +        """
  +        
  +        # Lock the module, while we work on it...
  +        lock=module.getLock()
  +        
  +        try:
  +            lock.acquire()
  +        
  +            if not module.isUpdated():
  +                
  +                # Perform Update
  +                self.updater.updateModule(module)        
  +        
  +                # Mark Updated
  +                module.setUpdated(True) #:TODO: Move this...
  +        
  +                # Fire event
  +                self.run.generateEvent(module)
  +        
  +                # Mark done in set
  +                self.run.gumpSet.setCompletedModule(module)
  +                
  +        finally:
  +            
  +            if lock:
  +                lock.release()
  +        
  +    ###########################################
   
       def performRun(self):
           
  -        self.initialize(1)
  +        self.initialize(True)
           
           printTopRefs(100,'Before Loop')
           
           gumpSet=self.run.getGumpSet()
           
  +        # Experimental...
  +        self.spawnUpdateThreads()
  +        
           # In order...
           for project in gumpSet.getProjectSequence():
   
               # Process the module, upon demand
               module=project.getModule()
               if not module.isUpdated():
  -                self.updater.updateModule(module)        
  -                module.setUpdated(1) #:TODO: Move this...
  -                self.run.generateEvent(module)
  -                gumpSet.setCompletedModule(module)
  +                self.performUpdate(module)
   
               # Process
               self.builder.buildProject(project)   
  @@ -83,6 +143,8 @@
               #invokeGarbageCollection(self.__class__.__name__)
               #invokeGarbageCollection(self.__class__.__name__)
               #printTopRefs(100,'After GC')
  +        
  +        self.waitForThreads()
           
           self.finalize()    
           
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +82 -0     gump/python/gump/performance/Attic/deps.py
  
  
  
  
  No                   revision
  No                   revision
  1.32.2.5  +3 -0      gump/python/gump/test/pyunit.py
  
  Index: pyunit.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/test/pyunit.py,v
  retrieving revision 1.32.2.4
  retrieving revision 1.32.2.5
  diff -u -r1.32.2.4 -r1.32.2.5
  --- pyunit.py	16 Jun 2004 17:50:40 -0000	1.32.2.4
  +++ pyunit.py	29 Jun 2004 19:30:42 -0000	1.32.2.5
  @@ -365,6 +365,9 @@
       from gump.test.loading import LoadingTestSuite  
       runner.addSuite(LoadingTestSuite())
       
  +    from gump.test.threads import ThreadingTestSuite  
  +    runner.addSuite(ThreadingTestSuite())
  +    
       # Any args are pattern matches
       patterns=list(sys.argv)
       del patterns[0:1]
  
  
  
  No                   revision
  
  Index: pyunit.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/test/pyunit.py,v
  retrieving revision 1.32.2.4
  retrieving revision 1.32.2.5
  diff -u -r1.32.2.4 -r1.32.2.5
  --- pyunit.py	16 Jun 2004 17:50:40 -0000	1.32.2.4
  +++ pyunit.py	29 Jun 2004 19:30:42 -0000	1.32.2.5
  @@ -365,6 +365,9 @@
       from gump.test.loading import LoadingTestSuite  
       runner.addSuite(LoadingTestSuite())
       
  +    from gump.test.threads import ThreadingTestSuite  
  +    runner.addSuite(ThreadingTestSuite())
  +    
       # Any args are pattern matches
       patterns=list(sys.argv)
       del patterns[0:1]
  
  
  
  No                   revision
  
  Index: pyunit.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/test/pyunit.py,v
  retrieving revision 1.32.2.4
  retrieving revision 1.32.2.5
  diff -u -r1.32.2.4 -r1.32.2.5
  --- pyunit.py	16 Jun 2004 17:50:40 -0000	1.32.2.4
  +++ pyunit.py	29 Jun 2004 19:30:42 -0000	1.32.2.5
  @@ -365,6 +365,9 @@
       from gump.test.loading import LoadingTestSuite  
       runner.addSuite(LoadingTestSuite())
       
  +    from gump.test.threads import ThreadingTestSuite  
  +    runner.addSuite(ThreadingTestSuite())
  +    
       # Any args are pattern matches
       patterns=list(sys.argv)
       del patterns[0:1]
  
  
  
  1.1.2.1   +74 -0     gump/python/gump/test/Attic/threads.py
  
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +109 -0    gump/python/gump/threads/Attic/tools.py
  
  
  
  
  1.1.2.1   +20 -0     gump/python/gump/threads/Attic/__init__.py
  
  
  
  
  1.1.2.1   +1 -0      gump/python/gump/threads/Attic/.cvsignore
  
  
  
  
  No                   revision
  No                   revision
  1.5.2.4   +6 -4      gump/python/gump/update/cvs.py
  
  Index: cvs.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/update/cvs.py,v
  retrieving revision 1.5.2.3
  retrieving revision 1.5.2.4
  diff -u -r1.5.2.3 -r1.5.2.4
  --- cvs.py	23 Jun 2004 21:38:42 -0000	1.5.2.3
  +++ cvs.py	29 Jun 2004 19:30:42 -0000	1.5.2.4
  @@ -71,8 +71,9 @@
           # Did we 'CVS checkout' already?
           exists	=	os.path.exists(module.getSourceControlStagingDirectory())
          
  -        if exists:
  -            self.performStatus(module)
  +        # Doesn't tell us much...
  +        #if exists:
  +        #    self.performStatus(module)
                   
           self.performUpdate(module,exists)        
           
  @@ -154,8 +155,9 @@
           (repository, root, command ) = self.getUpdateCommand(module,False)
           command.dump()
           
  -        (repository, root, command ) = self.getUpdateCommand(module,True,True)
  -        command.dump()
  +        # Doesn't tell us much...
  +        #(repository, root, command ) = self.getUpdateCommand(module,True,True)
  +        #command.dump()
               
           (repository, root, command ) = self.getUpdateCommand(module,True)
           command.dump()                       
  
  
  
  1.4.2.1   +7 -5      gump/python/gump/update/svn.py
  
  Index: svn.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/update/svn.py,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- svn.py	3 Jun 2004 19:06:12 -0000	1.4
  +++ svn.py	29 Jun 2004 19:30:42 -0000	1.4.2.1
  @@ -62,8 +62,9 @@
           # Did we 'SVN checkout' already?
           exists	=	os.path.exists(module.getSourceControlStagingDirectory())
          
  -        if exists:
  -            self.performStatus(module)
  +        # Doesn't teach us much
  +        #if exists:
  +        #    self.performStatus(module)
               
           self.performUpdate(module, exists)
           
  @@ -183,9 +184,10 @@
       def preview(self,module):
           (repository, url, command ) = self.getUpdateCommand(module,0)
           command.dump()
  -            
  -        command = self.getStatusCommand(module)
  -        command.dump()
  +          
  +        # Doesn't teach us much  
  +        # command = self.getStatusCommand(module)
  +        # command.dump()
               
           (repository, url, command ) = self.getUpdateCommand(module,1)
           command.dump()                                            
  
  
  
  No                   revision
  No                   revision
  1.9.2.27  +14 -3     gump/python/gump/document/xdocs/documenter.py
  
  Index: documenter.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/document/xdocs/documenter.py,v
  retrieving revision 1.9.2.26
  retrieving revision 1.9.2.27
  diff -u -r1.9.2.26 -r1.9.2.27
  --- documenter.py	29 Jun 2004 12:52:53 -0000	1.9.2.26
  +++ documenter.py	29 Jun 2004 19:30:43 -0000	1.9.2.27
  @@ -283,12 +283,23 @@
           envSection.createParagraph(
               """The environment that this Gump run was within.""")     
           
  +        descs={ 'Build':'Perform Build',
  +                'XDocs':'Generate XDOCS',
  +                'Statistics':'Update Statistics (to database)',
  +                'Verbose':'Verbose Run',
  +                'Cache':'Cache metadata (don\'t go to remote source)',
  +                'Text':'Text Output',
  +                'Official':'Official Run (e.g. nag notifies, etc.)',
  +                'Results':'Generate Results' }
           propertiesSection=envSection.createSection('Properties')
  -        envTable=propertiesSection.createTable(['Name','Value'])
  +        envTable=propertiesSection.createTable(['Name/Description','Value'])
           envs=0
           # iterate over this suites properties
           for (name,value) in getBeanAttributes(environment).items():
  -            envTable.createEntry(str(name),str(value))
  +            desc=name
  +            if descs.has_key(name):
  +                desc = descs[name] + ' (' + name + ')'
  +            envTable.createEntry(desc,str(value))
               envs+=1            
           if not envs: envTable.createEntry('None')
           
  @@ -1780,7 +1791,7 @@
                   id=jar.getId() or 'N/A'
                   outputRow.createData(id)    
           else:
  -            miscSection.createParagraph('No outputs (e.g. jars) produced')
  +            miscSection.createWarning('No outputs (e.g. jars) produced')
           
           if project.hasBuildCommand():
               
  
  
  
  No                   revision
  No                   revision
  1.24.2.11 +6 -0      gump/python/gump/model/object.py
  
  Index: object.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/model/object.py,v
  retrieving revision 1.24.2.10
  retrieving revision 1.24.2.11
  diff -u -r1.24.2.10 -r1.24.2.11
  --- object.py	28 Jun 2004 21:43:27 -0000	1.24.2.10
  +++ object.py	29 Jun 2004 19:30:43 -0000	1.24.2.11
  @@ -67,6 +67,9 @@
       	
           self.resolutionPerformed=False
           self.completionPerformed=False
  +        
  +        from threading import Lock
  +        self.lock=Lock()
       	
       def __del__(self):
           Annotatable.__del__(self)
  @@ -95,6 +98,9 @@
               
           self.shutdownWork()
           
  +    def getLock(self):
  +        return self.lock
  +    
       def isResolved(self):
           return self.resolutionPerformed
           
  
  
  

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


Mime
View raw message