ajack       2003/10/19 10:46:36

  Modified:    python/gump update.py integrate.py model.py launcher.py
                        context.py tools.py logic.py mailer.py conf.py
  Log:
  1) Be less verbose (unless asked to be)
  2) Second attempt at <ant <depend fix (set property name correctly)
  3) Add test for above to logic
  
  Revision  Changes    Path
  1.18      +23 -3     jakarta-gump/python/gump/update.py
  
  Index: update.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/update.py,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- update.py 13 Oct 2003 22:37:12 -0000      1.17
  +++ update.py 19 Oct 2003 17:46:36 -0000      1.18
  @@ -197,7 +197,27 @@
             # Prepare CVS checkout/update command...
             # 
             cmd=Cmd('cvs','update_'+name,workspace.cvsdir)
  +          
  +          #
  +          # Be 'quiet' (but not silent) unless requested otherwise.
  +          #
  +          if not module.debug and not module.verbose:
  +              cmd.addParameter('-q')
  +          
  +          #
  +          # Allow trace for debug
  +          #
  +          if module.debug:
  +              cmd.addParameter('-t')
  +          
  +          #
  +          # Request compression
  +          #
             cmd.addParameter('-z3')
  +          
  +          #
  +          # Set the CVS root
  +          #
             cmd.addParameter('-d', root)
       
             if os.path.exists(name):
  
  
  
  1.8       +6 -2      jakarta-gump/python/gump/integrate.py
  
  Index: integrate.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/integrate.py,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- integrate.py      13 Oct 2003 18:51:20 -0000      1.7
  +++ integrate.py      19 Oct 2003 17:46:36 -0000      1.8
  @@ -86,8 +86,12 @@
               #document(workspace,context,1,modules,sequence)
               document(workspace,context,1)
     
  -        # Nag about failures
  -        nag(workspace,context)
  +        #
  +        # Nag about failures -- only if we are allowed to
  +        #
  +        #
  +        if workspace.nag:
  +            nag(workspace,context)
     
           # Provide a news feed
           rss(workspace,context)
  
  
  
  1.31      +8 -11     jakarta-gump/python/gump/model.py
  
  Index: model.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/model.py,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- model.py  19 Oct 2003 00:09:10 -0000      1.30
  +++ model.py  19 Oct 2003 17:46:36 -0000      1.31
  @@ -387,11 +387,9 @@
         depend=Depend({'project':property.project})
         if not property.classpath: depend['noclasspath']=Single({})
         if property.runtime: depend['runtime']=property.runtime
  -      
  -      #
  +    
         # :TODO: AJ added this, no idea if it is right/needed.
  -      #
  -      if property.id: depend['ids']= [ property.id ]
  +      if property.id: depend['ids']= property.id
         
         # Add depend to project...
         project.depend.append(depend)
  @@ -404,7 +402,9 @@
         # Generate the property
         property=Property(depend.__dict__)
         property['reference']='jarpath'
  -      property['name']=depend.project
  +      property['name']=depend.property
  +      # :TODO: AJ added this, no idea if it is right/needed.
  +      if depend.id: property['ids']= depend.id
         # Store it
         self.property.append(property)      
         # Move onto project
  @@ -440,7 +440,6 @@
         try:
           self.value=Project.list[self.project].home
         except:
  -        log.debug( traceback.format_stack() )
           log.warn( "Cannot resolve homedir of " + self.project + " for " + 
project.name)
   
       elif self.reference=='srcdir':
  @@ -448,7 +447,6 @@
           module=Project.list[self.project].module
           self.value=Module.list[module].srcdir
         except:
  -        log.debug( traceback.format_stack() )
           log.warn( "Cannot resolve srcdir of " + self.project + " for " + 
project.name)
   
       elif self.reference=='jarpath':
  @@ -478,7 +476,6 @@
         except Exception, details:
           log.warn( "Cannot resolve jarpath of " + self.project + \
             " for " + project.name + ". Details: " + str(details))
  -        # log.debug( traceback.format_stack() )
           
   # TODO: set up the below elements with defaults using complete()
   
  
  
  
  1.19      +4 -4      jakarta-gump/python/gump/launcher.py
  
  Index: launcher.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/launcher.py,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- launcher.py       18 Oct 2003 14:54:08 -0000      1.18
  +++ launcher.py       19 Oct 2003 17:46:36 -0000      1.19
  @@ -244,16 +244,16 @@
           return overview
           
       def tail(self,lines):
  -        tail = "---------------------------------------------"
  +        tail = "---------------------------------------------\n"
           
           
           if self.output:
               from gump.tools import tailFileToString            
               tail += tailFileToString(self.output,lines)
           else:
  -            tail += "No output"
  +            tail += "No output\n"
               
  -        tail += "---------------------------------------------"
  +        tail += "---------------------------------------------\n"
               
           return tail
             
  @@ -274,7 +274,7 @@
   
   def killChildren():
       pid=os.getpid()
  -    log.warn('Kill all children (anything launched by Gumpy) [PID' + str(pid) + 
']')    
  +    log.warn('Kill all child processed (anything launched by Gumpy) [PID' + 
str(pid) + ']')    
       command='pkill -KILL -P ' + str(pid)
       exitcode=os.system(command)
       log.warn('Command: [' + command + '] exited with [' + str(exitcode) + ']')
  
  
  
  1.24      +3 -5      jakarta-gump/python/gump/context.py
  
  Index: context.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/context.py,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- context.py        18 Oct 2003 22:20:27 -0000      1.23
  +++ context.py        19 Oct 2003 17:46:36 -0000      1.24
  @@ -197,13 +197,11 @@
           self.command=command
           self.result=result
           
  -    def overview(self):
  +    def overview(self,lines=50):
           overview=TimedWorkItem.overview(self)
  -        overview += self.command.overview()
  -        
  +        overview += self.command.overview()        
           if self.result:
  -            overview+=self.result.tail(50)
  -            
  +            overview+=self.result.tail(lines)            
           return overview
           
       def tail(self,lines=50):
  
  
  
  1.7       +4 -3      jakarta-gump/python/gump/tools.py
  
  Index: tools.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/tools.py,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- tools.py  17 Oct 2003 16:03:00 -0000      1.6
  +++ tools.py  19 Oct 2003 17:46:36 -0000      1.7
  @@ -101,10 +101,11 @@
           cmd=Cmd('rsync','rsync_'+name,dir.work)            
           cmd.addParameter('-r')
           cmd.addParameter('-a')
  -        cmd.addParameter('-v')
  -        cmd.addParameter('-v')
  +        # Keep it quiet...
  +        # cmd.addParameter('-v')
  +        # cmd.addParameter('-v')
  +        # cmd.addParameter('--stats')        
           cmd.addParameter('--delete')
  -        cmd.addParameter('--stats')
           cmd.addParameter(sourcedir)
           cmd.addParameter(destdir)
   
  
  
  
  1.32      +20 -1     jakarta-gump/python/gump/logic.py
  
  Index: logic.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/logic.py,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- logic.py  18 Oct 2003 22:24:56 -0000      1.31
  +++ logic.py  19 Oct 2003 17:46:36 -0000      1.32
  @@ -266,15 +266,24 @@
       classpath=getClasspath(project,workspace,context)
       
       #
  -    # List properties
  +    # Get properties
       #
       properties=getAntProperties(workspace,ant)
      
       #
  +    # Get properties
  +    #
  +    jvmargs=getJVMArgs(workspace,ant)
  +   
  +    #
       # Run java on apache Ant...
       #
       cmd=Cmd(context.javaCommand,'build_'+module.name+'_'+project.name,\
               basedir,{'CLASSPATH':classpath})
  +            
  +    if jvmargs:
  +        cmd.addParameters(jvmargs)
  +            
       cmd.addParameter('org.apache.tools.ant.Main')  
       
       #
  @@ -564,6 +573,13 @@
       return classpath
               
     
  +def getJVMArgs(workspace,ant):
  +  """Get JVM arguments for a project"""
  +  args=Parameters()
  +  for jvmarg in ant.jvmarg:
  +    args.addParameter(jvmarg.value)
  +  return args
  +  
   def getAntProperties(workspace,ant):
     """Get properties for a project"""
     properties=Parameters()
  @@ -739,4 +755,7 @@
                 print " - " + str(p) + " : " + pp + " : " + ppp + " : " + str(p.note)
             else:
                 print " + " + str(p)
  +              
  +      cmd=getBuildCommand(workspace,Module.list[project.module],project,context)
   
  +      cmd.dump()
  \ No newline at end of file
  
  
  
  1.3       +5 -3      jakarta-gump/python/gump/mailer.py
  
  Index: mailer.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/mailer.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- mailer.py 15 Oct 2003 21:51:07 -0000      1.2
  +++ mailer.py 19 Oct 2003 17:46:36 -0000      1.3
  @@ -88,8 +88,8 @@
           server.set_debuglevel(1)
           server.sendmail(fromaddr, toaddrs, data)
           server.quit()
  -    except:
  -        log.error("Failed to send e-mail")
  +    except Exception, details:
  +        log.error("Failed to send e-mail: " + str(details))
           log.error("Server :" + str(server))
           log.error("From   :" + str(fromaddr))
           log.error("To     :" + str(toaddrs))
  @@ -106,6 +106,8 @@
      
     email=EmailMessage('There','Hi')
     
  -  mail(default.email,default.email,email,default.mailserver)
  +  mail([default.email],default.email,email,default.mailserver)
  +  
  +  mail([ '[EMAIL PROTECTED]' ],default.email,email,default.mailserver)
     
     
  
  
  
  1.25      +4 -4      jakarta-gump/python/gump/conf.py
  
  Index: conf.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/conf.py,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- conf.py   17 Oct 2003 16:03:00 -0000      1.24
  +++ conf.py   19 Oct 2003 17:46:36 -0000      1.25
  @@ -120,7 +120,7 @@
       
   class switch:
       """Configuration of switches """   
  -    optimize=0 # Optimize (at risk to exact correctness) anywhere one can
  +    optimize=1 # Optimize (at risk to exact correctness) anywhere one can
       optimizenetwork=1 # Do least network traffic 
       failtesting=0 # Not testing.. 
       debugging=0 # Not debugging..
  
  
  

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

Reply via email to