ajack       2003/09/24 12:19:13

  Modified:    python/gump document.py
  Log:
  Add <icon src="/resource/images/{state}_{reason}.png" alt="{state} {reason}
  
  Revision  Changes    Path
  1.25      +29 -2     jakarta-gump/python/gump/document.py
  
  Index: document.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/document.py,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- document.py       24 Sep 2003 18:24:21 -0000      1.24
  +++ document.py       24 Sep 2003 19:19:13 -0000      1.25
  @@ -194,6 +194,10 @@
       
       # Then generate...        
       forrest=Cmd('forrest','forrest',forrest)
  +    
  +    # Temporary
  +    forrest.addParameter('-debug')
  +    
       forrest.addPrefixedParameter('-D','java.awt.headless','true','=')
       forrest.addPrefixedParameter('-D','project.content-dir',  \
           content, '=')    
  @@ -282,7 +286,7 @@
           (mhours, mmins, msecs)       = mctxt.elapsedTime();
           x.write('     <tr><!-- %s -->' % (mname))        
           x.write('      <td><link href=\'%s\'>%s</link></td><td>%s</td>' % \
  -          (getModuleRelativeUrl(mname),mname,str(mctxt.aggregateStates())))    
  +          
(getModuleRelativeUrl(mname),mname,getStateIcons(mctxt.aggregateStates())))    
           x.write('      <td>%s:%s:%s</td>' % (str(mhours),str(mmins),str(msecs)))    
           x.write('     </tr>')
       if not mcount: x.write(' <tr><td>None</td></tr>')
  @@ -359,7 +363,12 @@
       xml = xmlize('workspace',workspace,f)
       f.close()  
       
  -        
  +def getStateIcons(pairs):
  +    icons=''
  +    for pair in pairs:
  +        icons+=getStatePairIcon(pair)
  +    return icons
  +    
   def 
documentModule(workspace,wdir,modulename,modulecontext,db,projectFilterList=None):
       mdir=getModuleDir(workspace,modulename,wdir)
       
  @@ -949,6 +958,24 @@
   def getWorkRelativeUrl(type,name):
       tdir=gumpSafeName(lower(workTypeName(type)))
       return tdir+'/'+gumpSafeName(name)+'.html'
  +    
  +def getStatePairIcon(pair,depth=0):
  +
  +    stateName=stateName(pair.status)
  +    reasonString=reasonString(pair.reason)    
  +    
  +    description=stateName    
  +    uniqueName=stateName
  +    if not pair.reason==REASON_UNSET: 
  +        description+=' '+reasonString
  +        uniqueName+='_'+reasonString
  +    
  +    # Build the URL
  +    iconName=gumpSafeName(uniqueName)
  +    url = getUp(depth)+"/resources/icons/"+iconName+".png";
  +    
  +    # Build the <icon xdoc
  +    return '<icon src=\'' + url + '\' alt=\'' + description +'\'/>'
       
   def getUp(depth):
       url=''
  
  
  

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

Reply via email to