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 2003/10/20 06:34:29 UTC

cvs commit: jakarta-gump/python/gump model.py launcher.py logic.py document.py

ajack       2003/10/19 21:34:29

  Modified:    python/gump model.py launcher.py logic.py document.py
  Log:
  Put default of project name if property name is missed off.
  
  Revision  Changes    Path
  1.33      +9 -4      jakarta-gump/python/gump/model.py
  
  Index: model.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/model.py,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- model.py	19 Oct 2003 22:00:38 -0000	1.32
  +++ model.py	20 Oct 2003 04:34:29 -0000	1.33
  @@ -402,7 +402,12 @@
         # Generate the property
         property=Property(depend.__dict__)
         property['reference']='jarpath'
  -      property['name']=depend.property
  +      # :TODO: AJ added this, and the 'elif' -- which seems wrong
  +      # but 
  +      if depend.property:
  +          property['name']=depend.property
  +      elif not hasattr(property,'name') or not property['name']:          
  +          property['name']=depend.project
         # :TODO: AJ added this, no idea if it is right/needed.
         if depend.id: property['ids']= depend.id
         # Store it
  
  
  
  1.20      +18 -5     jakarta-gump/python/gump/launcher.py
  
  Index: launcher.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/launcher.py,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- launcher.py	19 Oct 2003 17:46:36 -0000	1.19
  +++ launcher.py	20 Oct 2003 04:34:29 -0000	1.20
  @@ -85,7 +85,9 @@
   
   class Parameter:
       """Name/Value"""
  -    def __init__(self,name,value=None,separator=' ',prefix=None):
  +    def __init__(self,name,value=None,separator=' ',prefix=None):        
  +      if not name:
  +          raise 'Unnamed parameter'
         self.name=name
         self.value=value
         self.separator=separator
  @@ -162,12 +164,14 @@
         
   class Cmd:
       """Command Line (executable plus parameters)"""
  -    def __init__(self,command,name,cwd=None,env={}):
  +    def __init__(self,command,name,cwd=None,env=None,timeout=None):
           self.cmdpath=command
           self.name=name
           self.params=Parameters()
           self.env=env
  +        if not env: self.env={}
           self.cwd=cwd
  +        self.timeout=timeout
   
       def addParameter(self,name,val=None,separator=' '):
           self.params.addParameter(name,val,separator)
  @@ -272,7 +276,7 @@
       result.status=CMD_STATUS_SUCCESS  
       return result
   
  -def killChildren():
  +def killChildProcesses():
       pid=os.getpid()
       log.warn('Kill all child processed (anything launched by Gumpy) [PID' + str(pid) + ']')    
       command='pkill -KILL -P ' + str(pid)
  @@ -284,7 +288,7 @@
   #
   def timeoutHandler(signum, frame):
       log.info('Timeout Handler Called [Signal : ' + str(signum) + ']')
  -    killChildren()
  +    killChildProcesses()
       
   def execute(cmd,tmp=dir.tmp):
       res=CmdResult(cmd)
  @@ -356,7 +360,8 @@
           # Set the signal handler and an N-second alarm
           if not os.name == 'dos' and not os.name == 'nt':
               signal.signal(signal.SIGALRM, timeoutHandler)
  -            signal.alarm(setting.timeout)
  +            timeout=cmd.timeout or setting.timeout
  +            signal.alarm(timeout)
   
           # Execute Command & Wait
           result.exit_code=os.system(execString + ' >>' + str(outputFile) + ' 2>&1')
  @@ -431,4 +436,12 @@
     cmd=Cmd('ls','ls-test')
     result = execute(cmd)  
     dump(result);
  +  
  +  cmd=Cmd('sleep','sleep-test')
  +  cmd.addParameter("30")
  +  cmd.timeout=10
  +  result = execute(cmd)  
  +  dump(result);
  +  
  +  
     
  
  
  
  1.34      +2 -2      jakarta-gump/python/gump/logic.py
  
  Index: logic.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/logic.py,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- logic.py	19 Oct 2003 22:00:38 -0000	1.33
  +++ logic.py	20 Oct 2003 04:34:29 -0000	1.34
  @@ -760,5 +760,5 @@
                 print " + " + str(p)
                 
         cmd=getBuildCommand(workspace,Module.list[project.module],project,context)
  -
  -      cmd.dump()
  \ No newline at end of file
  +      if cmd:
  +          cmd.dump()
  \ No newline at end of file
  
  
  
  1.88      +20 -16    jakarta-gump/python/gump/document.py
  
  Index: document.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/document.py,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- document.py	19 Oct 2003 22:00:38 -0000	1.87
  +++ document.py	20 Oct 2003 04:34:29 -0000	1.88
  @@ -300,10 +300,17 @@
       titledDataInTableXDoc(x,"CVS Directory : ", str(workspace.cvsdir))
       titledDataInTableXDoc(x,"Package Directory : ", str(workspace.pkgdir))
       titledDataInTableXDoc(x,"List Address: ", str(workspace.mailinglist))
  -    titledDataInTableXDoc(x,"Email Address: ", str(workspace.email))
  -    titledDataInTableXDoc(x,"Email Server: ", str(workspace.mailserver))
  +    titledDataInTableXDoc(x,"E-mail Address: ", str(workspace.email))
  +    titledDataInTableXDoc(x,"E-mail Server: ", str(workspace.mailserver))
       titledDataInTableXDoc(x,"Prefix: ", str(workspace.prefix))
       titledDataInTableXDoc(x,"Signature: ", str(workspace.signature))
  +    
  +    # Does this workspace send nag mails?
  +    if workspace.nag:
  +        nag='true'
  +    else:
  +        nag='false'
  +    titledDataInTableXDoc(x,"Send Nag E-mails: ", nag)
       endTableXDoc(x)
       endSectionXDoc(x)       
       
  @@ -834,21 +841,18 @@
               startSectionXDoc(x,title)    
               x.write('<table><tr><th>Prefix</th><th>Name</th><th>Value</th></tr>')
               for param in work.command.params.items():
  -                if param.name:
  -                    x.write('<tr><td>')
  -                    if param.prefix: 
  -                      x.write(param.prefix)
  -                    x.write('</td><td>')
  -                    x.write(param.name)
  -                    x.write('</td><td>')
  -                    val = param.value
  -                    if val:
  -                        x.write(val)
  -                    else:
  -                        x.write('N/A')
  -                    x.write('</td></tr>\n')  
  +                x.write('<tr><td>')
  +                if param.prefix: 
  +                    x.write(param.prefix)
  +                x.write('</td><td>')
  +                x.write(param.name)
  +                x.write('</td><td>')
  +                val = param.value
  +                if val:
  +                    x.write(val)
                   else:
  -                    log.error('Bogus parameter on ' + str(param))
  +                    x.write('N/A')
  +                x.write('</td></tr>\n')  
                       
               x.write('</table>\n')
               endSectionXDoc(x)