ajack 2003/10/27 08:40:55
Modified: python/gump context.py document.py
Log:
1) Count projects that this module/it's projects caused to fail.
2) Display above in TODOs
3) Don't display 'other' unless set. [Trap for incomplete extensions later]
Revision Changes Path
1.32 +26 -3 jakarta-gump/python/gump/context.py
Index: context.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/context.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- context.py 27 Oct 2003 05:36:58 -0000 1.31
+++ context.py 27 Oct 2003 16:40:54 -0000 1.32
@@ -637,7 +637,7 @@
def getDepends(self):
if self.totalDepends: return self.totalDepends
- for pctxt in self.subcontexts.values():
+ for pctxt in self:
if not pctxt in self.totalDepends:
self.totalDepends.append(pctxt)
for ppctxt in pctxt.getDepends():
@@ -665,7 +665,8 @@
# Get a summary of states for each project
def getProjectSummary(self,summary=None):
- if hasattr(self,'summary'): return self.summary
+ # Fails 'ocs count into other's summary
+ # if hasattr(self,'summary'): return self.summary
if not summary:
summary=Summary()
@@ -676,11 +677,33 @@
for ctxt in self:
summary.addState(ctxt.getStatePair())
+ # Fails, see above.
# Store for later...
- self.summary = summary
+ # self.summary = summary
return summary
+ def determineAffected(self):
+ affected=0
+
+ # Get all dependenees (optional/otherwise)
+ dependees=self.getDependees()
+
+ # Look through all dependees
+ for pctxt in dependees:
+ cause=pctxt.cause
+ #
+ # Something caused this some grief
+ #
+ if cause:
+ #
+ # The something was this module or one of it's projects
+ #
+ if cause == self or cause in self.subcontexts.values():
+ affected += 1
+
+ return affected
+
class GumpContext(Context):
"""Gump Run Context"""
def __init__(self,name="Gump",parent=None):
1.97 +18 -6 jakarta-gump/python/gump/document.py
Index: document.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/document.py,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -r1.96 -r1.97
--- document.py 27 Oct 2003 05:36:58 -0000 1.96
+++ document.py 27 Oct 2003 16:40:54 -0000 1.97
@@ -296,7 +296,8 @@
titledDataInTableXDoc(x,"Elapsed Time : ", str(hours) + ':' + str(mins) + ':' +
str(secs))
titledDataInTableXDoc(x,"Base Directory : ", str(workspace.basedir))
titledDataInTableXDoc(x,"Temporary Directory : ", str(workspace.tmpdir))
- titledDataInTableXDoc(x,"Scratch Directory : ", str(workspace.scratchdir))
+ if workspace.scratchdir:
+ titledDataInTableXDoc(x,"Scratch Directory : ", str(workspace.scratchdir))
# :TODO: We have duplicate dirs? tmp = scratch?
titledDataInTableXDoc(x,"Log Directory : ", str(workspace.logdir))
titledDataInTableXDoc(x,"Jars Repository : ", str(workspace.jardir))
@@ -339,7 +340,7 @@
startSectionXDoc(x,'Modules with TODOs')
startTableXDoc(x)
x.write(' <tr>')
- x.write(' <th>Name</th><th>Duration</th><th>Module State</th><th>Project
State(s)</th><th>Elapsed Time</th>')
+ x.write(' <th>Name</th><th>Affects</th><th>Duration</th><th>Module
State</th><th>Project State(s)</th><th>Elapsed Time</th>')
x.write(' </tr>')
mcount=0
for mctxt in context:
@@ -361,6 +362,7 @@
mcount+=1
# Determine longest sequence in this (failed) state...
+ # for any of the projects
seq=0
for pctxt in mctxt:
if pctxt.status==STATUS_FAILED:
@@ -373,9 +375,17 @@
if stats.sequenceInState > seq: seq = stats.sequenceInState
+ #
+ # Determine the number of projects this module (or it's projects)
+ # cause not to be run.
+ #
+ affected=determineAffected(mctxt)
+
+ # Display
x.write(' <tr><!-- %s -->\n' % (mname))
- x.write(' <td><link
href=\'%s\'>%s</link></td><td>%s</td><td>%s</td><td>%s</td>\n' % \
+ x.write(' <td><link
href=\'%s\'>%s</link></td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>\n' % \
(getModuleRelativeUrl(mname),mname, \
+ affected, \
seq, \
getStateIcon(mctxt), \
getStateIcons(mctxt)))
@@ -801,7 +811,7 @@
x.write(' </table>\n')
endSectionXDoc(x)
-def documentSummary(x,summary,description='Project(s) Summary'):
+def documentSummary(x,summary,description='Project Summary'):
if not summary or not summary.projects: return
startSectionXDoc(x,description)
startTableXDoc(x)
@@ -813,7 +823,8 @@
insertTableHeaderXDoc(x, 'Prereqs')
insertTableHeaderXDoc(x, 'No Works')
insertTableHeaderXDoc(x, 'Packages')
- insertTableHeaderXDoc(x, 'Others')
+ if summary.others:
+ insertTableHeaderXDoc(x, 'Others')
endTableRowXDoc(x)
startTableRowXDoc(x)
@@ -823,7 +834,8 @@
insertTableDataXDoc(x, summary.prereqs)
insertTableDataXDoc(x, summary.noworks)
insertTableDataXDoc(x, summary.packages)
- insertTableDataXDoc(x, summary.others)
+ if summary.others:
+ insertTableDataXDoc(x, summary.others)
endTableRowXDoc(x)
endTableXDoc(x)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]