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/11/03 21:28:18 UTC

cvs commit: jakarta-gump/python/gump document.py

ajack       2003/11/03 12:28:18

  Modified:    .        gumpy.sh
               python/gump document.py
  Log:
  1) Fix in projects.xml
  2) Attempt to link to build failure from state icon
  
  Revision  Changes    Path
  1.22      +1 -1      jakarta-gump/gumpy.sh
  
  Index: gumpy.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/gumpy.sh,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- gumpy.sh	2 Nov 2003 21:45:59 -0000	1.21
  +++ gumpy.sh	3 Nov 2003 20:28:18 -0000	1.22
  @@ -139,7 +139,7 @@
   echo $SEPARATOR >> $GUMP_LOG
   export >> $GUMP_LOG
   # Capture Python Version
  -python -V >> $GUMP_LOG
  +python -V >> $GUMP_LOG 2>&1
   
   #
   # Do the integration run
  @@ -197,8 +197,7 @@
   pkill -KILL -P $$ 
   
   # $Log$
  -# Revision 1.21  2003/11/02 21:45:59  ajack
  -# 1) Added Krysalis BarCode to profile
  -# 2) Display Python Version in gumpy.sh
  -# 3) Display Python version in documentation.
  +# Revision 1.22  2003/11/03 20:28:18  ajack
  +# 1) Fix in projects.xml
  +# 2) Attempt to link to build failure from state icon
   #
  
  
  
  1.102     +33 -13    jakarta-gump/python/gump/document.py
  
  Index: document.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/document.py,v
  retrieving revision 1.101
  retrieving revision 1.102
  diff -u -r1.101 -r1.102
  --- document.py	3 Nov 2003 19:42:45 -0000	1.101
  +++ document.py	3 Nov 2003 20:28:18 -0000	1.102
  @@ -455,7 +455,7 @@
           x.write('     </tr>')
           pcount=0
           for project in projectList:
  -            pctxt=ontext.getProjectContextForProject(project)
  +            pctxt=context.getProjectContextForProject(project)
               pname=pctxt.name
               pcount+=1
   
  @@ -569,7 +569,7 @@
       
   def getStateIcon(context):
       icon=getStatePairIcon(context.getStatePair())
  -    href=getContextLink(context,0,icon)
  +    href=getContextStateLink(context,0,icon)
       return href
       
   def documentModule(workspace,context,wdir,modulename,modulecontext,db,projectList=None):
  @@ -1333,19 +1333,39 @@
       url += getContextUrl(context,0)
       return url
           
  -def getContextUrl(context,depth=1):
  -    if isinstance(context,GumpContext):
  -        url=getWorkspaceRelativeUrl(depth)
  -    elif isinstance(context,ModuleContext):
  -        url=getModuleRelativeUrl(context.name,depth)
  -    else:        
  -        url=getModuleProjectRelativeUrl(context.parent.name,context.name,depth)
  +        
  +def getContextUrl(context,depth=1,state=0):
  +    url=None
  +    #
  +    # If we are looking for what set the state, look at
  +    # work first. Pick the first...
  +    #
  +    if state:
  +        for work in context.worklist:
  +            if not url:
  +                if not work.status==STATUS_SUCCESS:
  +                    url=getWorkRelativeUrl(work.type,work.command.name)
  +        
  +    #
  +    # Otherwise return link to context...
  +    #     
  +    if not url:
  +        if isinstance(context,GumpContext):
  +            url=getWorkspaceRelativeUrl(depth)
  +        elif isinstance(context,ModuleContext):
  +            url=getModuleRelativeUrl(context.name,depth)
  +        else:        
  +            url=getModuleProjectRelativeUrl(context.parent.name,context.name,depth)
  +            
       return url
   
   def getTypedContextLink(context,depth=1):
       return getContextLink(context,depth,None,1)
   
  -def getContextLink(context,depth=1,xdata=None,typed=0):
  +def getContextStateLink(context,depth=1,xdata=None,typed=0):
  +    return getContextLink(context,depth,xdata,typed,1)
  +    
  +def getContextLink(context,depth=1,xdata=None,typed=0,state=0):
       if not xdata:
           description=""
           if typed:
  @@ -1357,16 +1377,16 @@
                   description="Project: "
           description+=context.name
       
  -        return getLink(getContextUrl(context,depth),description)
  +        return getLink(getContextUrl(context,depth,state),description)
       else:
  -        return getXLink(getContextUrl(context,depth),xdata)
  +        return getXLink(getContextUrl(context,depth,state),xdata)
       
   def getContextStateDescription(context):
       xdoc=stateName(context.status)
       if not context.reason==REASON_UNSET: xdoc+=' with reason '+reasonString(context.reason)
       if context.cause and not context.cause == context:
           xdoc+=", caused by "
  -        xdoc+=getContextLink(context.cause)
  +        xdoc+=getContextStateLink(context.cause)
       return xdoc
   
   def getWorkspaceRelativeUrl(depth=0):