ajack 2003/09/24 11:24:21
Modified: python/gump context.py document.py
Log:
1) Added StatePair.__cmp__ in attempt to make states list only unique pairs, somehow
getting duplicates
2) Added @@DATE@@ to documentation
3) Removed "module state" from front page, was misleading (since projects in module
can fail w/ module state = success)
Revision Changes Path
1.8 +7 -0 jakarta-gump/python/gump/context.py
Index: context.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/context.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- context.py 23 Sep 2003 23:16:20 -0000 1.7
+++ context.py 24 Sep 2003 18:24:21 -0000 1.8
@@ -291,6 +291,11 @@
def __eq__(self,other):
return self.state == other.state and self.reason == other.reason
+
+ def __cmp__(self,other):
+ cmp = self.state < other.state
+ if not cmp: cmp = self.reason < other.reason
+ return cmp
class Context:
"""Context for a single entity"""
@@ -346,8 +351,10 @@
def aggregateStates(self, states=None):
if not states: states=[]
pair=self.getStatePair()
+ # Add self, if not already there
if not stateUnset(pair.state) and not pair in states: \
states.append(pair)
+ # Subbordinates
for ctxt in self:
ctxt.aggregateStates(states)
return states;
1.24 +5 -3 jakarta-gump/python/gump/document.py
Index: document.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/document.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- document.py 23 Sep 2003 23:16:20 -0000 1.23
+++ document.py 24 Sep 2003 18:24:21 -0000 1.24
@@ -249,6 +249,8 @@
if workspace.version:
titledDataInTableXDoc(x,'Workspace Version', workspace.version)
titledDataInTableXDoc(x,'Java Command', context.javaCommand)
+ titledDataInTableXDoc(x,'@@DATE@@', str(default.date))
+
endTableXDoc(x)
endSectionXDoc(x)
@@ -269,7 +271,7 @@
startSectionXDoc(x,'Modules')
startTableXDoc(x)
x.write(' <tr>')
- x.write(' <th>Name</th><th>State</th><th>Project State(s)</th><th>Elapsed
Time</th>')
+ x.write(' <th>Name</th><th>Project State(s)</th><th>Elapsed Time</th>')
x.write(' </tr>')
mcount=0
for mctxt in context:
@@ -279,8 +281,8 @@
mcount+=1
(mhours, mmins, msecs) = mctxt.elapsedTime();
x.write(' <tr><!-- %s -->' % (mname))
- x.write(' <td><link href=\'%s\'>%s</link></td><td>%s</td><td>%s</td>'
% \
-
(getModuleRelativeUrl(mname),mname,stateName(mctxt.status),str(mctxt.aggregateStates())))
+ x.write(' <td><link href=\'%s\'>%s</link></td><td>%s</td>' % \
+ (getModuleRelativeUrl(mname),mname,str(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>')
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]