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/notify notifier.py
Date Wed, 02 Jun 2004 15:59:11 GMT
ajack       2004/06/02 08:59:11

  Modified:    python/gump/build maven.py ant.py script.py builder.py
               python/gump preview.py
               python/gump/runner runner.py
               python/gump/utils __init__.py
               python/gump/update updater.py cvs.py jars.py svn.py
               python/gump/notify notifier.py
  Log:
  1) Re-enable preview
  2) Fix counter on 'unsent'.
  
  Revision  Changes    Path
  1.5       +6 -1      gump/python/gump/build/maven.py
  
  Index: maven.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/build/maven.py,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- maven.py	26 May 2004 23:23:34 -0000	1.4
  +++ maven.py	2 Jun 2004 15:59:11 -0000	1.5
  @@ -266,4 +266,9 @@
       def locateMavenProjectFile(self,project):
           """Return Maven project file location"""      
           basedir = project.maven.getBaseDirectory() or project.getBaseDirectory()
  -        return os.path.abspath(os.path.join(basedir,'project.xml'))  
  \ No newline at end of file
  +        return os.path.abspath(os.path.join(basedir,'project.xml'))  
  +        
  +    def preview(self,project,stats):        
  +        command=self.getMavenCommand(project) 
  +        command.dump()
  +            
  \ No newline at end of file
  
  
  
  1.4       +4 -2      gump/python/gump/build/ant.py
  
  Index: ant.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/build/ant.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ant.py	25 May 2004 22:46:00 -0000	1.3
  +++ ant.py	2 Jun 2004 15:59:11 -0000	1.4
  @@ -194,8 +194,6 @@
                   cmd.addParameter(targetParam)
       
           return cmd
  -
  -                
     
       def getAntProperties(self,project):
           """Get properties for a project"""
  @@ -210,4 +208,8 @@
           for property in project.getWorkspace().getSysProperties()+project.getAnt().getSysProperties():
               properties.addPrefixedNamedParameter('-D',property.name,property.value,'=')
           return properties
  +                
  +    def preview(self,project,stats):        
  +        command=self.getAntCommand(project) 
  +        command.dump()
    
  
  
  
  1.4       +6 -0      gump/python/gump/build/script.py
  
  Index: script.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/build/script.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- script.py	25 May 2004 22:46:00 -0000	1.3
  +++ script.py	2 Jun 2004 15:59:11 -0000	1.4
  @@ -134,4 +134,10 @@
           #    cmd.addParameter('-verbose')  
           
           return cmd
  +        
  +        
  +    def preview(self,project,stats):        
  +        command=self.getScriptCommand(project) 
  +        command.dump()
  + 
       
  
  
  
  1.4       +21 -2     gump/python/gump/build/builder.py
  
  Index: builder.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/build/builder.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- builder.py	25 May 2004 22:46:00 -0000	1.3
  +++ builder.py	2 Jun 2004 15:59:11 -0000	1.4
  @@ -135,7 +135,7 @@
           if project.hasStats():
               stats=project.getStats()
           
  -        # Code this nicer, perhaps...    
  +        # :TODO: Code this nicer, perhaps...    
           if project.isPackaged():             
               self.performProjectPackageProcessing(project, stats)
               return
  @@ -165,7 +165,6 @@
               elif project.hasMaven():
                   self.maven.buildProject(project, stats)
               
  -            
               if not project.okToPerformWork() and not project.isDebug():
                   # Display...
                   project.addInfo('Enable "debug" output, due to build failure.')
  @@ -461,3 +460,23 @@
                   listDirectoryToFileHolder(project,project.getHomeDirectory(),	\
                       FILE_TYPE_PACKAGE, 'list_package_'+project.getName())             
                              
           
  +        
  +    def preview(self,project):
  +        
  +        # Extract stats (in case we want to do conditional processing)            
  +        stats=None
  +        if project.hasStats():
  +            stats=project.getStats()
  +        
  +        if project.isPackaged():             
  +            print 'Packaged project: ' + project.getName()
  +        
  +        # Pick your poison..
  +        if project.hasScript():
  +            self.script.preview(project, stats)
  +        elif project.hasAnt():
  +            self.ant.preview(project, stats)
  +        elif project.hasMaven():
  +            self.maven.preview(project, stats)
  +        else:
  +            print 'No builder for project: ' + project.getName()
  
  
  
  1.4       +12 -10    gump/python/gump/preview.py
  
  Index: preview.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/preview.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- preview.py	30 Apr 2004 18:55:07 -0000	1.3
  +++ preview.py	2 Jun 2004 15:59:11 -0000	1.4
  @@ -36,6 +36,7 @@
   from gump.core.commandLine import handleArgv
   from gump.model.loader import WorkspaceLoader
   
  +from gump.runner.runner import getRunner
   
   ###############################################################################
   # Initialize
  @@ -65,26 +66,27 @@
       run=GumpRun(workspace,ps,options)    
       run.dump()
       
  +    runner=getRunner(run)
  +    
  +    updater=runner.getUpdater()
  +    builder=runner.getBuilder()
  +    
       # Display some interesting things...
       # E.g. command lines, env
       # :TODO:
           
       for module in run.getGumpSet().getModules():
           print "-------------------------------------------------------------"
  -        print "Module : " + `module` + "\n"
  +        print `module`
           if module.isUpdatable():
  -            (repository, root, command ) = module.getUpdateCommand(0)
  -            command.dump()
  -            
  -            (repository, root, command ) = module.getUpdateCommand(1)
  -            command.dump()                                  
  +            updater.preview(module)
  +                       
           
       for project in run.getGumpSet().getProjects():
           print "-------------------------------------------------------------"
  -        print "Project : " + `project` + "\n"
  +        print `project`
           if project.hasBuildCommand():
  -            command=project.getBuildCommand() 
  -            command.dump()
  +            builder.preview(project)
               
       # bye!
       sys.exit(result)
  
  
  
  1.5       +6 -0      gump/python/gump/runner/runner.py
  
  Index: runner.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/runner/runner.py,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- runner.py	25 May 2004 22:46:00 -0000	1.4
  +++ runner.py	2 Jun 2004 15:59:11 -0000	1.5
  @@ -138,6 +138,12 @@
       def finalize(self):            
           # About to shutdown...
           self.run.dispatchEvent(FinalizeRunEvent(self.run))
  +        
  +    def getUpdater(self):
  +        return self.updater
  +        
  +    def getBuilder(self):
  +        return self.builder
   
   def getRunner(run):
       from gump.runner.demand import OnDemandRunner
  
  
  
  1.43      +1 -1      gump/python/gump/utils/__init__.py
  
  Index: __init__.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/utils/__init__.py,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- __init__.py	27 May 2004 14:35:28 -0000	1.42
  +++ __init__.py	2 Jun 2004 15:59:11 -0000	1.43
  @@ -414,7 +414,7 @@
           threshold = gc.get_threshold()
           tracked = len(gc.get_objects())
       
  -        log.info('GC: Enabled %s : Tracked %s : Threshold %s' \
  +        log.debug('GC: Enabled %s : Tracked %s : Threshold %s' \
                   % (`enabled`, `tracked`,`threshold`))
                   
           #gc.set_debug(gc.DEBUG_LEAK)
  
  
  
  1.3       +13 -0     gump/python/gump/update/updater.py
  
  Index: updater.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/update/updater.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- updater.py	21 May 2004 23:15:06 -0000	1.2
  +++ updater.py	2 Jun 2004 15:59:11 -0000	1.3
  @@ -173,3 +173,16 @@
               log.error('Synchronize Failed ' + str(details), exc_info=1)
              
           return module.okToPerformWork()
  +        
  +
  +    def preview(self,module):
  +        
  +        
  +        if module.hasCvs():
  +            ok=self.cvs.preview(module)
  +        elif module.hasSvn():
  +            ok=self.svn.preview(module)
  +        elif module.hasJars():
  +            ok=self.jars.preview(module)        
  +        else:
  +            print 'No updater for module: ' + module.getName()            
  \ No newline at end of file
  
  
  
  1.3       +12 -1     gump/python/gump/update/cvs.py
  
  Index: cvs.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/update/cvs.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- cvs.py	21 May 2004 23:15:06 -0000	1.2
  +++ cvs.py	2 Jun 2004 15:59:11 -0000	1.3
  @@ -145,7 +145,18 @@
                                   + `module.getPosition()` + \
                                   '] : ' + module.getName())
                                    
  -     
  +    def preview(self,module):
  +                
  +        (repository, root, command ) = self.getUpdateCommand(module,0)
  +        command.dump()
  +        
  +        (repository, root, command ) = self.getUpdateCommand(module,1,1)
  +        command.dump()
  +            
  +        (repository, root, command ) = self.getUpdateCommand(module,1)
  +        command.dump()                       
  +        
  +    
       def getUpdateCommand(self,module,exists=0,nowork=0):
           """
           
  
  
  
  1.3       +6 -1      gump/python/gump/update/jars.py
  
  Index: jars.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/update/jars.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jars.py	21 May 2004 23:15:06 -0000	1.2
  +++ jars.py	2 Jun 2004 15:59:11 -0000	1.3
  @@ -97,7 +97,12 @@
                   
           return module.okToPerformWork()                                               
 
       
  -   
  +     
  +    def preview(self,module):
  +            
  +        (repository, url, command ) = self.getUpdateCommand(module,1)
  +        command.dump()                                            
  +    
        
       def getJarsUpdateCommand(self,module,exists=0):
           
  
  
  
  1.3       +11 -1     gump/python/gump/update/svn.py
  
  Index: svn.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/update/svn.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- svn.py	21 May 2004 23:15:06 -0000	1.2
  +++ svn.py	2 Jun 2004 15:59:11 -0000	1.3
  @@ -178,7 +178,17 @@
                   module.changeState(STATE_SUCCESS,REASON_UPDATE_FAILED)
           else:
               module.changeState(STATE_SUCCESS)       
  -                                                              
  +                         
  +                             
  +    def preview(self,module):
  +        (repository, url, command ) = self.getUpdateCommand(module,0)
  +        command.dump()
  +            
  +        (repository, url, command ) = self.getStatusCommand(module)
  +        command.dump()
  +            
  +        (repository, url, command ) = self.getUpdateCommand(module,1)
  +        command.dump()                                            
       
       def getUpdateCommand(self,module,exists=0):
           """
  
  
  
  1.4       +4 -1      gump/python/gump/notify/notifier.py
  
  Index: notifier.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/notify/notifier.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- notifier.py	24 May 2004 16:39:08 -0000	1.3
  +++ notifier.py	2 Jun 2004 15:59:11 -0000	1.4
  @@ -205,7 +205,7 @@
               
   The following %s notify%s should have been sent
   
  -""" % (`self.unwanteds`, plural)
  +""" % (`count`, plural)
               
               content += SEPARATOR
               content += '\n'
  @@ -344,6 +344,9 @@
               sent=0
               log.error('Failed to send notify e-mail: ' + str(details), \
                           exc_info=1)
  +                        
  +            # :TODO: Find a way to include this log information in
  +            # the content stored (and e-mailed) below.
                     
           if not sent:
               self.addUnsent(subject,content)                
  
  
  

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


Mime
View raw message