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 2004/05/18 01:45:52 UTC

cvs commit: gump/python/gump/utils listener.py

ajack       2004/05/17 16:45:52

  Modified:    python/gump/results Tag: MultiRunner resulter.py
               python/gump/syndication Tag: MultiRunner syndicator.py
                        rss.py atom.py
               python/gump/document/text Tag: MultiRunner documenter.py
               python/gump/document Tag: MultiRunner documenter.py
               python/gump/test Tag: MultiRunner notifying.py resulting.py
               python/gump/update Tag: MultiRunner updater.py cvs.py
               python/gump/core Tag: MultiRunner gumprun.py tasks.py
                        runner.py gumpinit.py misc.py
               python/gump/net Tag: MultiRunner __init__.py
               python/gump/build Tag: MultiRunner builder.py script.py
                        abstract.py
               python/gump/utils Tag: MultiRunner listener.py
  Added:       python/gump/notify Tag: MultiRunner notifier.py __init__.py
                        .cvsignore
               python/gump/syndication Tag: MultiRunner abstract.py
               python/gump/document/xdocs Tag: MultiRunner resolver.py
                        .cvsignore xdoc.py __init__.py documenter.py
               python/gump/stats Tag: MultiRunner __init__.py statsdb.py
                        .cvsignore
               python/gump/repository Tag: MultiRunner publisher.py
                        .cvsignore jars.py __init__.py
               python/gump/guru Tag: MultiRunner xref.py stats.py
               python/gump/net Tag: MultiRunner smtp.py
  Removed:     python/gump/document/forrest Tag: MultiRunner documenter.py
                        resolver.py xdoc.py .cvsignore __init__.py
               python/gump/output Tag: MultiRunner notify.py .cvsignore
                        repository.py xref.py __init__.py statsdb.py
               python/gump/net Tag: MultiRunner mailer.py
  Log:
  Work in progress, parts all over the garage floor...
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.23.2.1  +3 -2      gump/python/gump/results/resulter.py
  
  Index: resulter.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/results/resulter.py,v
  retrieving revision 1.23
  retrieving revision 1.23.2.1
  diff -u -r1.23 -r1.23.2.1
  --- resulter.py	26 Apr 2004 16:13:56 -0000	1.23
  +++ resulter.py	17 May 2004 23:45:50 -0000	1.23.2.1
  @@ -38,10 +38,11 @@
   from gump.results.loader import *
   
                  
  -class Resulter:
  +class Resulter(RunActor):
       
       def __init__(self,run):        
  -        self.run = run
  +        RunActor.__init__(self,run)
  +        
           self.workspace=run.getWorkspace()
           self.gumpSet=run.getGumpSet()
           
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +460 -0    gump/python/gump/notify/Attic/notifier.py
  
  
  
  
  1.1.2.1   +18 -0     gump/python/gump/notify/Attic/__init__.py
  
  
  
  
  1.1.2.1   +1 -0      gump/python/gump/notify/Attic/.cvsignore
  
  
  
  
  No                   revision
  No                   revision
  1.19.2.1  +0 -242    gump/python/gump/syndication/syndicator.py
  
  Index: syndicator.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/syndication/syndicator.py,v
  retrieving revision 1.19
  retrieving revision 1.19.2.1
  diff -u -r1.19 -r1.19.2.1
  --- syndicator.py	17 Feb 2004 21:54:21 -0000	1.19
  +++ syndicator.py	17 May 2004 23:45:50 -0000	1.19.2.1
  @@ -1,245 +1,3 @@
  -#!/usr/bin/env python
  -
  -# $Header$
  -# $Revision$
  -# $Date$
  -#
  -# ====================================================================
  -#
  -# The Apache Software License, Version 1.1
  -#
  -# Copyright (c) 2003 The Apache Software Foundation.  All rights
  -# reserved.
  -#
  -# Redistribution and use in source and binary forms, with or without
  -# modification, are permitted provided that the following conditions
  -# are met:
  -#
  -# 1. Redistributions of source code must retain the above copyright
  -#    notice, this list of conditions and the following disclaimer.
  -#
  -# 2. Redistributions in binary form must reproduce the above copyright
  -#    notice, this list of conditions and the following disclaimer in
  -#    the documentation and/or other materials provided with the
  -#    distribution.
  -#
  -# 3. The end-user documentation included with the redistribution, if
  -#    any, must include the following acknowlegement:
  -#       "This product includes software developed by the
  -#        Apache Software Foundation (http://www.apache.org/)."
  -#    Alternately, this acknowlegement may appear in the software itself,
  -#    if and wherever such third-party acknowlegements normally appear.
  -#
  -# 4. The names "The Jakarta Project", "Alexandria", and "Apache Software
  -#    Foundation" must not be used to endorse or promote products derived
  -#    from this software without prior written permission. For written
  -#    permission, please contact apache@apache.org.
  -#
  -# 5. Products derived from this software may not be called "Apache"
  -#    nor may "Apache" appear in their names without prior written
  -#    permission of the Apache Group.
  -#
  -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  -# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  -# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  -# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  -# SUCH DAMAGE.
  -# ====================================================================
  -#
  -# This software consists of voluntary contributions made by many
  -# individuals on behalf of the Apache Software Foundation.  For more
  -# information on the Apache Software Foundation, please see
  -# <http://www.apache.org/>.
  -
  -"""
  -  Highly experimental RSS feeds.
  -"""
  -
  -import os
  -import time
  -
  -from xml.sax.saxutils import escape
  -
  -from gump import log
  -from gump.model.state import *
  -from gump.model.project import ProjectStatistics
  -
  -
  -class Syndicator:
  -    def __init__(self):     pass        
  -        
  -    #
  -    # Populate a method called 'document(run)'
  -    #
  -    def syndicate(self,run):
  -        if not hasattr(self,'syndicateRun'):
  -            raise RuntimeError, 'Complete [' + `self.__class__` + '] with syndicateRun(self,run)'
  -        
  -        if not callable(self.syndicateRun):
  -            raise RuntimeException, 'Complete [' + `self.__class__` + '] with a callable syndicateRun(self,run)'
  -        
  -        log.info('Syndicate run using [' + `self` + ']')
  -        
  -        self.syndicateRun(run)
  -
  -    def getProjectContent(self,project,run):
  -        
  -        resolver=run.getOptions().getResolver()
  -        
  -        stats=project.getStats()
  -        
  -        content='<p>Project ' + project.getName()  + ', '
  -                                
  -        content += self.getStateContent(project.getStatePair())
  -                        
  -        content += 'Duration in state: <b>' + `stats.sequenceInState` + '</b> (runs) '
  -        
  -        if not stats.previousState == STATE_NONE \
  -            and not stats.previousState == STATE_UNSET:
  -            content += ', Previous state: <b>' \
  -                                    + stateDescription(stats.previousState)  \
  -                                    + '</b>'
  -    
  -        content += '</p>'
  -        
  -        if project.hasDescription or project.getModule().hasDescription():
  -            content+='<p>'           
  -            if project.hasDescription(): 
  -                content+=project.getDescription()
  -            else:
  -                content+=project.getModule().getDescription()
  -            content+='<p>'
  -            
  -        content += self.getSundries(project)
  -                
  -        return content
  -
  -    
  -
  -    def getModuleContent(self,module,run):
  -        
  -        resolver=self.run.getOptions().getResolver()
  -        
  -        stats=module.getStats()
  -        
  -        content='<p>Module ' + module.getName() + ', '
  -                                    
  -        content += self.getStateContent(module.getStatePair())
  -        
  -        content += 'Duration in state: <b>' + `stats.sequenceInState`  + '</b> (runs)'
  -                        
  -        if not stats.previousState == STATE_NONE \
  -            and not stats.previousState == STATE_UNSET:
  -            content += ', Previous state: <b>' \
  -                                    + stateDescription(stats.previousState) \
  -                                    + '</b>'
  -                                    
  -        content += '</p>'
  -    
  -        if module.hasDescription():
  -            content+='<p>'            
  -            content+=module.getDescription()
  -            content+='</p>'
  -            
  -        content += self.getSundries(module)
  -                
  -        return content
  -
  -    def getStateContent(self,statePair):
  -        
  -        resolver=self.run.getOptions().getResolver()    
  -        
  -        content = 'Gump State: ' + statePair.getStateDescription()	
  -                            
  -        if not statePair.isReasonUnset():
  -           content += ' with reason ' \
  -                + statePair.getReasonDescription()
  -        
  -        content += ( '&nbsp;<img src=\'%s\' alt=\'%s\'/>' ) % \
  -            resolver.getStateIconInformation(statePair)
  -            
  -        content += '<br/><br/>'
  -        
  -        return content
  -        
  -    def getSundries(self,object):
  -        
  -        content = ''
  -        
  -        resolver=self.run.getOptions().getResolver()    
  -        
  -        if object.annotations:
  -            content += '<p><table>'
  -            for note in object.annotations:
  -                    content += ('<tr><td>' \
  -                        + note.getLevelName() + '</td><td>' \
  -                        + note.getText() + '</td></tr>\n')                
  -            content += '<table></p>'
  -         
  -        #
  -        # They can come visit for this...
  -        #
  -           
  -        #if object.worklist:
  -        #    content += '<p><table>'    
  -        #    for work in object.worklist:
  -        #        url=resolver.getAbsoluteUrl(work)
  -        #        state=stateDescription(work.state)                 
  -        #        content += ('<tr><td><a href=\'' + 	\
  -        #            url + '\'>' + work.getName() + 	\
  -        #            '</a></td><td>' + state + 		\
  -        #            '</td></tr>\n')                   
  -        #    content += '</table></p>'
  -        
  -        return content
  -
  -    #
  -    # Only report once per state change
  -    # Don't report on prereq failed, or if just came from that
  -    # Don't report on packages
  -    # Don't report on bogus states (testing)
  -    #
  -    def moduleOughtBeWidelySyndicated(self, module):
  -        
  -        stats=module.getStats()
  -        
  -        return stats.sequenceInState == 1	\
  -            and not stats.currentState == STATE_PREREQ_FAILED \
  -            and not stats.currentState == STATE_UNSET \
  -            and not stats.currentState == STATE_NONE \
  -            and not stats.currentState == STATE_COMPLETE  \
  -            and not ( \
  -                stats.currentState == STATE_SUCCESS and	\
  -                stats.previousState == STATE_PREREQ_FAILED ) \
  -            and not module.isPackaged()       
  -              
  -              
  -    #
  -    # Only report once per state change
  -    # Don't report on prereq failed, or if just came from that
  -    # Don't report on packages
  -    # Don't report on bogus states (testing)
  -    #
  -    def projectOughtBeWidelySyndicated(self, project):
  -        
  -        stats=project.getStats()
  -        
  -        return stats.sequenceInState == 1	\
  -            and not stats.currentState == STATE_PREREQ_FAILED \
  -            and not stats.currentState == STATE_UNSET \
  -            and not stats.currentState == STATE_NONE \
  -            and not stats.currentState == STATE_COMPLETE 	\
  -            and not ( \
  -                stats.currentState == STATE_SUCCESS and	\
  -                stats.previousState == STATE_PREREQ_FAILED ) \
  -            and not project.isPackaged()    
                 
   def syndicate(run):
   
  
  
  
  1.23.2.2  +4 -4      gump/python/gump/syndication/rss.py
  
  Index: rss.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/syndication/rss.py,v
  retrieving revision 1.23.2.1
  retrieving revision 1.23.2.2
  diff -u -r1.23.2.1 -r1.23.2.2
  --- rss.py	17 May 2004 21:41:21 -0000	1.23.2.1
  +++ rss.py	17 May 2004 23:45:50 -0000	1.23.2.2
  @@ -75,7 +75,7 @@
   
   from gump.core.config import setting
   
  -from gump.syndication.syndicator import Syndicator
  +from gump.syndication.abstract import AbstractSyndicator
   
   ###############################################################################
   
  
  
  
  1.16.2.2  +4 -4      gump/python/gump/syndication/atom.py
  
  Index: atom.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/syndication/atom.py,v
  retrieving revision 1.16.2.1
  retrieving revision 1.16.2.2
  diff -u -r1.16.2.1 -r1.16.2.2
  --- atom.py	17 May 2004 21:41:21 -0000	1.16.2.1
  +++ atom.py	17 May 2004 23:45:50 -0000	1.16.2.2
  @@ -73,7 +73,7 @@
   
   from gump.core.config import setting
   
  -from gump.syndication.syndicator import Syndicator
  +from gump.syndication.abstract import AbstractSyndicator
   
   ###############################################################################
   
  
  
  
  No                   revision
  
  Index: atom.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/syndication/atom.py,v
  retrieving revision 1.16.2.1
  retrieving revision 1.16.2.2
  diff -u -r1.16.2.1 -r1.16.2.2
  --- atom.py	17 May 2004 21:41:21 -0000	1.16.2.1
  +++ atom.py	17 May 2004 23:45:50 -0000	1.16.2.2
  @@ -73,7 +73,7 @@
   
   from gump.core.config import setting
   
  -from gump.syndication.syndicator import Syndicator
  +from gump.syndication.abstract import AbstractSyndicator
   
   ###############################################################################
   
  
  
  
  No                   revision
  
  Index: atom.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/syndication/atom.py,v
  retrieving revision 1.16.2.1
  retrieving revision 1.16.2.2
  diff -u -r1.16.2.1 -r1.16.2.2
  --- atom.py	17 May 2004 21:41:21 -0000	1.16.2.1
  +++ atom.py	17 May 2004 23:45:50 -0000	1.16.2.2
  @@ -73,7 +73,7 @@
   
   from gump.core.config import setting
   
  -from gump.syndication.syndicator import Syndicator
  +from gump.syndication.abstract import AbstractSyndicator
   
   ###############################################################################
   
  
  
  
  1.1.2.1   +242 -0    gump/python/gump/syndication/Attic/abstract.py
  
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +253 -0    gump/python/gump/document/xdocs/Attic/resolver.py
  
  
  
  
  1.1.2.1   +1 -0      gump/python/gump/document/xdocs/Attic/.cvsignore
  
  
  
  
  1.1.2.1   +747 -0    gump/python/gump/document/xdocs/Attic/xdoc.py
  
  
  
  
  1.1.2.1   +29 -0     gump/python/gump/document/xdocs/Attic/__init__.py
  
  
  
  
  1.1.2.1   +3276 -0   gump/python/gump/document/xdocs/Attic/documenter.py
  
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +18 -0     gump/python/gump/stats/Attic/__init__.py
  
  
  
  
  1.1.2.1   +369 -0    gump/python/gump/stats/Attic/statsdb.py
  
  
  
  
  1.1.2.1   +1 -0      gump/python/gump/stats/Attic/.cvsignore
  
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +33 -0     gump/python/gump/repository/Attic/publisher.py
  
  
  
  
  1.1.2.1   +1 -0      gump/python/gump/repository/Attic/.cvsignore
  
  
  
  
  1.1.2.1   +76 -0     gump/python/gump/repository/Attic/jars.py
  
  
  
  
  1.1.2.1   +21 -0     gump/python/gump/repository/Attic/__init__.py
  
  
  
  
  No                   revision
  No                   revision
  1.5.2.1   +1 -1      gump/python/gump/document/text/documenter.py
  
  Index: documenter.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/document/text/documenter.py,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  --- documenter.py	30 Apr 2004 19:18:12 -0000	1.5
  +++ documenter.py	17 May 2004 23:45:51 -0000	1.5.2.1
  @@ -48,7 +48,7 @@
           # Hack, ought return a non-hierarchical one
           self.resolver=TextResolver(dirBase,urlBase)
           
  -    def getResolverForRun(self,run):
  +    def getResolver(self,run):
           return self.resolver
           
       def documentEntity(self, entity, run):
  
  
  
  No                   revision
  No                   revision
  1.15.2.1  +17 -14    gump/python/gump/document/documenter.py
  
  Index: documenter.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/document/documenter.py,v
  retrieving revision 1.15
  retrieving revision 1.15.2.1
  diff -u -r1.15 -r1.15.2.1
  --- documenter.py	16 Apr 2004 20:38:11 -0000	1.15
  +++ documenter.py	17 May 2004 23:45:51 -0000	1.15.2.1
  @@ -27,32 +27,35 @@
   
   from gump import log
   
  -class Documenter:
  -    def __init__(self):  pass
  +class Documenter(RunActor):
  +
  +    def __init__(self, run):        
  +        #
  +        RunSpecific.__init__(self, run)
       
       #
       # Call a method called 'prepareRun(run)', if it
       # is available on the sub-class (i.e. if needed)
       #
  -    def prepare(self,run):
  +    def prepare(self):
           if not hasattr(self,'prepareRun'): return        
           if not callable(self.prepareRun):  return        
           log.debug('Prepare to document run using [' + `self` + ']')        
  -        self.prepareRun(run)
  +        self.prepareRun()       
           
       #
       # Call a method called 'documentEntity(entity,run)'
       #
  -    def entity(self,entity,run):
  +    def entity(self,entity):
           if not hasattr(self,'documentEntity'): return
           if not callable(self.documentEntity): return        
           log.debug('Document entity [' + `entity` + '] using [' + `self` + ']')        
  -        self.documentEntity(entity,run)
  +        self.documentEntity(entity)
       
       #
       # Call a method called 'documentRun(run)'
       #
  -    def document(self,run):
  +    def document(self):
           if not hasattr(self,'documentRun'):
               raise RuntimeError, \
                       'Class [' + `self.__class__` + '] needs a documentRun(self,run)'
  @@ -63,16 +66,16 @@
           
           log.debug('Document run using [' + `self` + ']')
           
  -        self.documentRun(run)
  +        self.documentRun()
           
       #
       # Get a Resolver (specifically for this run)
       #
  -    def getResolver(self,run):
  -        if not hasattr(self,'getResolverForRun'):
  -            raise RuntimeError, 'Class [' + `self.__class__` + '] needs a getResolverForRun(self,run)'
  +    def getResolver(self,):
  +        if not hasattr(self,'getResolver'):
  +            raise RuntimeError, 'Class [' + `self.__class__` + '] needs a getResolver(self)'
           
  -        if not callable(self.getResolverForRun):
  -            raise RuntimeError, 'Class [' + `self.__class__` + '] needs a callable getResolverForRun(self,run)'
  +        if not callable(self.getResolver):
  +            raise RuntimeError, 'Class [' + `self.__class__` + '] needs a callable getResolver(self)'
               
  -        return self.getResolverForRun(run)
  \ No newline at end of file
  +        return self.getResolver()
  \ No newline at end of file
  
  
  
  No                   revision
  No                   revision
  1.1.2.2   +1 -1      gump/python/gump/test/Attic/notifying.py
  
  Index: notifying.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/test/Attic/notifying.py,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- notifying.py	17 May 2004 20:22:03 -0000	1.1.2.1
  +++ notifying.py	17 May 2004 23:45:51 -0000	1.1.2.2
  @@ -27,7 +27,7 @@
   from gump.test import getWorkedTestWorkspace
   from gump.test.pyunit import UnitTestSuite
   from gump.output.notify import notify,Notifier
  -from gump.net.mailer import *
  +from gump.net.smtp import *
   
   class NotificationTestSuite(UnitTestSuite):
       def __init__(self):
  
  
  
  1.7.2.1   +1 -1      gump/python/gump/test/resulting.py
  
  Index: resulting.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/test/resulting.py,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- resulting.py	16 Apr 2004 17:28:35 -0000	1.7
  +++ resulting.py	17 May 2004 23:45:51 -0000	1.7.2.1
  @@ -30,7 +30,7 @@
   from gump.results.model import *
   from gump.results.resulter import generateResults,Resulter
   from gump.results.loader import WorkspaceResultLoader
  -from gump.net.mailer import *
  +from gump.net.smtp import *
   
   class ResultingTestSuite(UnitTestSuite):
       def __init__(self):
  
  
  
  No                   revision
  No                   revision
  1.1.2.3   +4 -6      gump/python/gump/update/Attic/updater.py
  
  Index: updater.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/update/Attic/updater.py,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- updater.py	17 May 2004 21:41:22 -0000	1.1.2.2
  +++ updater.py	17 May 2004 23:45:52 -0000	1.1.2.3
  @@ -48,10 +48,10 @@
   # Classes
   ###############################################################################
   
  -class GumpUpdater(Runnable):
  +class GumpUpdater(RunSpecific):
       
       def __init__(self,run):
  -        Runnable.__init__(self, run)
  +        RunSpecific.__init__(self, run)
           
           self.cvs=CvsUpdater(run)
           #self.svn=SvnUpdater(run)
  @@ -141,10 +141,8 @@
               if ok:
                   self.syncModule(module)     
                       
  -        # Incremental documentation...
  -        documenter=self.run.getOptions().getDocumenter()        
  -        if documenter :
  -            documenter.entity(module,self.run)      
  +        # Generate/process the module event...
  +        self.run.generateEvent(module)      
   
       
       def syncModule(self,module):
  
  
  
  1.1.2.2   +2 -2      gump/python/gump/update/Attic/cvs.py
  
  Index: cvs.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/update/Attic/cvs.py,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- cvs.py	17 May 2004 20:22:04 -0000	1.1.2.1
  +++ cvs.py	17 May 2004 23:45:52 -0000	1.1.2.2
  @@ -48,10 +48,10 @@
   # Classes
   ###############################################################################
   
  -class CvsUpdater(Runnable):
  +class CvsUpdater(RunSpecific):
       
       def __init__(self,run):
  -        Runnable.__init__(self,run)
  +        RunSpecific.__init__(self,run)
   
           #
           # A stash of known logins.
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +170 -0    gump/python/gump/guru/Attic/xref.py
  
  
  
  
  1.1.2.1   +93 -0     gump/python/gump/guru/Attic/stats.py
  
  
  
  
  No                   revision
  No                   revision
  1.5.2.2   +66 -15    gump/python/gump/core/gumprun.py
  
  Index: gumprun.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/core/gumprun.py,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- gumprun.py	17 May 2004 20:22:03 -0000	1.5.2.1
  +++ gumprun.py	17 May 2004 23:45:52 -0000	1.5.2.2
  @@ -50,8 +50,6 @@
   ###############################################################################
   # Functions
   ###############################################################################
  -def isAllProjects(pexpr):
  -    return pexpr=='all' or pexpr=='*'
   
   ###############################################################################
   # Classes
  @@ -125,7 +123,7 @@
           
       # All Projects
       def isFull(self):
  -        return isAllProjects(self.projectexpression)
  +        return self.projectexpression=='all' or self.projectexpression=='*'    
           
   #  if not projects:
   #    print
  @@ -364,7 +362,7 @@
           self.xdocs=0
           
           # The implementation that will do it...
  -        self.documenter=TextDocumenter()
  +        self.documenter=TextDocumenter()      
   
       def setDocumenter(self, documenter):
           self.documenter = documenter
  @@ -424,7 +422,41 @@
           
       def setVerbose(self,verbose):
           self.verbose=verbose
  +
  +
  +class RunSpecific:
  +    
  +    def __init__(self, run):
  +        self.run	=	run
           
  +    def getRun(self):
  +        return self.run
  +
  +class RunEvent(RunSpecific):
  +            
  +    def __init__(self, run, entity):
  +        RunSpecific.__init(self,run)
  +        
  +        self.entity=entity
  +        
  +    def getEntity(self):
  +        return self.entity        
  +        
  +class  RunActor(RunSpecific):     
  +    
  +    def __init__(self, run):
  +        RunSpecific.__init(self,run)
  +        
  +    #
  +    # Call a method called 'prepareRun(run)', if it
  +    # is available on the sub-class (i.e. if needed)
  +    #
  +    def _processEvent(self,event):
  +        if not hasattr(self,'processEvent'): return        
  +        if not callable(self.processEvent):  return        
  +        log.debug('Process event [' + `event` + '] using [' + `self` + ']')        
  +        self.processEvent()
  +                
   class GumpRun(Workable,Annotatable,Stateful):
       def __init__(self,workspace,expr=None,options=None,env=None):
           
  @@ -462,6 +494,24 @@
           # A repository interface...
           #
           self.outputsRepository=JarRepository(workspace.jardir)
  +                  
  +        # Generate a GUID (or close)
  +        import md5
  +        import socket        
  +        m=md5.new()
  +        self.guid = `socket.gethostname()`  + ':' + workspace.getName() + ':' + default.datetime
  +        m.append(self.guid)
  +        self.hexguid=m.hexdigest()     
  +        log.debug('Run GUID [' + `self.guid` + '] using [' + `self.hexguid` + ']')    
  +        
  +        # Actor Queue
  +        self.actors=list()
  +
  +    def getRunGuid(self):
  +        return self.id
  +        
  +    def getRunHexGuid(self):
  +        return self.hexguid
           
       def getWorkspace(self):
           return self.workspace
  @@ -487,15 +537,16 @@
           i=getIndent(indent)
           #output.write(i+'Expression: ' + self.gumpSet. + '\n')
           output.write(i+'Gump Set:\n')
  -        
           self.gumpSet.dump(indent+1,output)
  -        
  -class Runnable:
  -    
  -    def __init__(self, run):
  -        self.run	=	run
  -        
  -    def getRun(self):
  -        return self.run
  -        
  -        
  +       
  +    def registerActor(self,actor):
  +        log.debug('Registor Actor : ' + `actor`)
  +        self.actors.append(actor)
  +        
  +    def processEvent(self,event):
  +        for actor in self.actors:
  +            actor._processEvent(event)
  +            
  +    def generateEvent(self,entity):
  +        self.processEvent(RunEvent(entity))
  +                
  
  
  
  1.1.2.3   +0 -4      gump/python/gump/core/Attic/tasks.py
  
  Index: tasks.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/core/Attic/tasks.py,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- tasks.py	17 May 2004 21:41:22 -0000	1.1.2.2
  +++ tasks.py	17 May 2004 23:45:52 -0000	1.1.2.3
  @@ -86,8 +86,6 @@
           
       # A few proxies...
       
  -    def preprocess(self): self.misc.preprocess()
  -    
       def loadStatistics(self): self.misc.loadStatistics()
       def updateStatistics(self): self.misc.updateStatistics()
       
  @@ -103,8 +101,6 @@
       def notify(self): self.misc.notify()
       
       def syndicate(self): self.misc.syndicate()
  -    
  -    def setEndTime(self): self.misc.setEndTime()
       
       ###########################################
       
  
  
  
  1.1.2.3   +65 -3     gump/python/gump/core/Attic/runner.py
  
  Index: runner.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/core/Attic/runner.py,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- runner.py	17 May 2004 21:41:22 -0000	1.1.2.2
  +++ runner.py	17 May 2004 23:45:52 -0000	1.1.2.3
  @@ -38,17 +38,79 @@
   ###############################################################################
   
   
  -class GumpRunner(Runnable):
  +class GumpRunner(RunSpecific):
   
       def __init__(self, run):
           
           #
  -        Runnable.__init__(self, run)
  +        RunSpecific.__init__(self, run)
           
  -        self.misc=GumpMiscellaneous(run)    
  +        # Main players
  +        self.misc=GumpMiscellaneous(run)            
           self.updater=GumpUpdater(run)
           self.builder=GumpBuilder(run)
           
  +    def preprocess(self,exitOnError=1):
  +        
  +        logResourceUtilization('Before preprocess')
  +        
  +        #
  +        # Perform start-up logic 
  +        #
  +        workspace = self.run.getWorkspace()
  +                
  +        #
  +        #
  +        #
  +        if not self.run.getOptions().isQuick():
  +            logResourceUtilization('Before check environment')            
  +            self.run.getEnvironment().checkEnvironment(exitOnError)
  +            logResourceUtilization('After check environment')
  +        
  +        #
  +        # Modify the log location on the fly, if --dated
  +        #
  +        if self.run.getOptions().isDated():
  +            workspace.setDatedDirectories()
  +        
  +        #
  +        # Use Forrest if available & not overridden...
  +        #
  +        if self.run.getEnvironment().noForrest \
  +            or self.run.getOptions().isText() :
  +            self.documenter=TextDocumenter(self.run)
  +        else:
  +            self.documenter=XDocDocumenter(	self.run,	\
  +                                            workspace.getBaseDirectory(), \
  +                                             workspace.getLogUrl())                        
  +        self.run.getOptions().setDocumenter(documenter)
  +                    
  +        # Check the workspace
  +        if not workspace.getVersion() >= setting.ws_version:
  +            message='Workspace version ['+str(workspace.getVersion())+'] below preferred [' + setting.ws_version + ']'
  +            workspace.addWarning(message)
  +            log.warn(message)   
  +            
  +        # Check the workspace
  +        if not workspace.getVersion() >= setting.ws_minimum_version:
  +            message='Workspace version ['+str(workspace.getVersion())+'] below minimum [' + setting.ws_minimum_version + ']'
  +            workspace.addError(message)
  +            log.error(message)   
  +            
  +        # Write workspace to a 'merge' file        
  +        if not self.run.getOptions().isQuick():
  +            workspace.writeXMLToFile(default.merge)
  +            workspace.setMergeFile(default.merge)
  +                 
  +        # :TODO: Put this somewhere else, and/or make it depend upon something...
  +        workspace.changeState(STATE_SUCCESS)
  + 
  +                    
  +    def setEndTime(self):
  +        
  +        logResourceUtilization('Set End Time')
  +        # :TODO: Move this to run
  +        self.run.getWorkspace().setEndTime()
   
   def getRunner(run):
       from gump.core.tasks import SequentialTaskRunner
  
  
  
  1.2.2.1   +2 -1      gump/python/gump/core/gumpinit.py
  
  Index: gumpinit.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/core/gumpinit.py,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- gumpinit.py	22 Apr 2004 22:58:16 -0000	1.2
  +++ gumpinit.py	17 May 2004 23:45:52 -0000	1.2.2.1
  @@ -51,4 +51,5 @@
   
       default.ltime=time.localtime(default.time)
       default.date = time.strftime('%Y%m%d',default.ltime)
  +    default.datetime = time.strftime('%Y%m%d% %H:%M:%S',default.ltime)
       
  
  
  
  1.1.2.3   +3 -63     gump/python/gump/core/Attic/misc.py
  
  Index: misc.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/core/Attic/misc.py,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- misc.py	17 May 2004 21:41:22 -0000	1.1.2.2
  +++ misc.py	17 May 2004 23:45:52 -0000	1.1.2.3
  @@ -43,7 +43,7 @@
   from gump.net.cvs import *
   
   from gump.document.text.documenter import TextDocumenter
  -from gump.document.forrest.documenter import ForrestDocumenter
  +from gump.document.xdocs.documenter import XDocDocumenter
   
   from gump.output.statsdb import *
   from gump.output.repository import JarRepository
  @@ -56,71 +56,11 @@
   # Classes
   ###############################################################################
   
  -class GumpMiscellaneous(Runnable):
  +class GumpMiscellaneous(RunSpecific):
       
       def __init__(self,run):
  -        Runnable.__init__(self,run)
  +        RunSpecific.__init__(self,run)
   
  -    def preprocess(self,exitOnError=1):
  -        
  -        logResourceUtilization('Before preprocess')
  -        
  -        #
  -        # Perform start-up logic 
  -        #
  -        workspace = self.run.getWorkspace()
  -                
  -        #
  -        #
  -        #
  -        if not self.run.getOptions().isQuick():
  -            logResourceUtilization('Before check environment')            
  -            self.run.getEnvironment().checkEnvironment(exitOnError)
  -            logResourceUtilization('After check environment')
  -        
  -        #
  -        # Modify the log location on the fly, if --dated
  -        #
  -        if self.run.getOptions().isDated():
  -            workspace.setDatedDirectories()
  -        
  -        #
  -        # Use forrest if available & not overridden...
  -        #
  -        if self.run.getEnvironment().noForrest \
  -            or self.run.getOptions().isText() :
  -            documenter=TextDocumenter()
  -        else:
  -            documenter=ForrestDocumenter(workspace.getBaseDirectory(), \
  -                                         workspace.getLogUrl())                        
  -        self.run.getOptions().setDocumenter(documenter)
  -                    
  -        # Check the workspace
  -        if not workspace.getVersion() >= setting.ws_version:
  -            message='Workspace version ['+str(workspace.getVersion())+'] below preferred [' + setting.ws_version + ']'
  -            workspace.addWarning(message)
  -            log.warn(message)   
  -            
  -        # Check the workspace
  -        if not workspace.getVersion() >= setting.ws_minimum_version:
  -            message='Workspace version ['+str(workspace.getVersion())+'] below minimum [' + setting.ws_minimum_version + ']'
  -            workspace.addError(message)
  -            log.error(message)   
  -            
  -        # Write workspace to a 'merge' file        
  -        if not self.run.getOptions().isQuick():
  -            workspace.writeXMLToFile(default.merge)
  -            workspace.setMergeFile(default.merge)
  -                 
  -        # :TODO: Put this somewhere else, and/or make it depend upon something...
  -        workspace.changeState(STATE_SUCCESS)
  -
  -                    
  -    def setEndTime(self):
  -        
  -        logResourceUtilization('Set End Time')
  -        # :TODO: Move this to run
  -        self.run.getWorkspace().setEndTime()
           
       """
       
  
  
  
  No                   revision
  No                   revision
  1.3.2.1   +2 -2      gump/python/gump/net/__init__.py
  
  Index: __init__.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/net/__init__.py,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- __init__.py	16 Mar 2004 19:50:15 -0000	1.3
  +++ __init__.py	17 May 2004 23:45:52 -0000	1.3.2.1
  @@ -22,6 +22,6 @@
   # Initialize
   ###############################################################################
   
  -# tell Python what modules make up the gump.model package
  -__all__ = ["cvs","mailer"]
  +# tell Python what modules make up the gump.net package
  +__all__ = ["cvs","smtp"]
   
  
  
  
  No                   revision
  
  Index: __init__.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/net/__init__.py,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- __init__.py	16 Mar 2004 19:50:15 -0000	1.3
  +++ __init__.py	17 May 2004 23:45:52 -0000	1.3.2.1
  @@ -22,6 +22,6 @@
   # Initialize
   ###############################################################################
   
  -# tell Python what modules make up the gump.model package
  -__all__ = ["cvs","mailer"]
  +# tell Python what modules make up the gump.net package
  +__all__ = ["cvs","smtp"]
   
  
  
  
  No                   revision
  
  Index: __init__.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/net/__init__.py,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- __init__.py	16 Mar 2004 19:50:15 -0000	1.3
  +++ __init__.py	17 May 2004 23:45:52 -0000	1.3.2.1
  @@ -22,6 +22,6 @@
   # Initialize
   ###############################################################################
   
  -# tell Python what modules make up the gump.model package
  -__all__ = ["cvs","mailer"]
  +# tell Python what modules make up the gump.net package
  +__all__ = ["cvs","smtp"]
   
  
  
  
  1.1.2.1   +145 -0    gump/python/gump/net/Attic/smtp.py
  
  
  
  
  No                   revision
  No                   revision
  1.1.2.2   +6 -9      gump/python/gump/build/Attic/builder.py
  
  Index: builder.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/build/Attic/builder.py,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- builder.py	17 May 2004 20:22:04 -0000	1.1.2.1
  +++ builder.py	17 May 2004 23:45:52 -0000	1.1.2.2
  @@ -48,10 +48,10 @@
   # Classes
   ###############################################################################
   
  -class GumpBuilder(Runnable):
  +class GumpBuilder(RunSpecific):
       
       def __init__(self,run):
  -        Runnable.__init__(self,run)
  +        RunSpecific.__init__(self,run)
           
           self.ant=AntBuilder(run)
           #self.maven=MavenBuilder(run)
  @@ -168,13 +168,10 @@
       
           if project.isFailed():
               log.warn('Failed to build project #[' + `project.getPosition()` + '] : [' + project.getName() + '], state:' \
  -                    + project.getStateDescription())
  -                           
  -            
  -        # Incremental documentation...
  -        documenter=self.run.getOptions().getDocumenter()        
  -        if documenter :
  -            documenter.entity(project,self.run)
  +                    + project.getStateDescription())                           
  +                    
  +        # Generate/process the project event...
  +        self.run.generateEvent(project)      
   
   
       def performDelete(self,project,delete,index=0):
  
  
  
  1.1.2.2   +2 -2      gump/python/gump/build/Attic/script.py
  
  Index: script.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/build/Attic/script.py,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- script.py	17 May 2004 20:22:04 -0000	1.1.2.1
  +++ script.py	17 May 2004 23:45:52 -0000	1.1.2.2
  @@ -45,10 +45,10 @@
   # Classes
   ###############################################################################
   
  -class AntBuilder(Runnable):
  +class AntBuilder(RunSpecific):
       
       def __init__(self,run):
  -        Runnable.__init__(self,run)
  +        RunSpecific.__init__(self,run)
   
       def buildProject(self,project,stats)
           
  
  
  
  1.1.2.3   +2 -2      gump/python/gump/build/Attic/abstract.py
  
  Index: abstract.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/build/Attic/abstract.py,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- abstract.py	17 May 2004 21:41:22 -0000	1.1.2.2
  +++ abstract.py	17 May 2004 23:45:52 -0000	1.1.2.3
  @@ -45,10 +45,10 @@
   # Classes
   ###############################################################################
   
  -class AbstractJavaBuilder(Runnable):
  +class AbstractJavaBuilder(RunSpecific):
       
       def __init__(self,run):
  -        Runnable.__init__(self,run)
  +        RunSpecific.__init__(self,run)
   
   
       def getJVMArgs(self,xml):
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +3 -1      gump/python/gump/utils/listener.py
  
  Index: listener.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/utils/listener.py,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- listener.py	16 Mar 2004 19:50:15 -0000	1.1
  +++ listener.py	17 May 2004 23:45:52 -0000	1.1.2.1
  @@ -18,7 +18,9 @@
   
   
   """
  -    xdoc generation, for forrest
  +
  +    Generic Listener
  +    
   """
   
   import socket
  
  
  

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