ajack 2003/09/29 16:54:50
Modified: python/gump repository.py context.py logic.py document.py
Log:
Had state !- status variable mismatch, try to convert all to status
Revision Changes Path
1.2 +1 -22 jakarta-gump/python/gump/repository.py
Index: repository.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/repository.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- repository.py 29 Sep 2003 22:28:53 -0000 1.1
+++ repository.py 29 Sep 2003 23:54:50 -0000 1.2
@@ -61,28 +61,7 @@
"""
A Repository
"""
-class RepositoryEntry:
- """Contains epository Conten"""
- def __init__(self,state=STATUS_UNSET,reason=REASON_UNSET):
- self.state=state
- self.reason=reason
-
- def __repr__(self):
- return str(self)
-
- def __str__(self):
- result=stateName(self.state)
- if not self.reason == REASON_UNSET:
- result += ":" + reasonString(self.reason)
- return result
-
- 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 Repository:
"""Contains Repository Contents"""
1.15 +19 -19 jakarta-gump/python/gump/context.py
Index: context.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/context.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- context.py 29 Sep 2003 17:47:18 -0000 1.14
+++ context.py 29 Sep 2003 23:54:50 -0000 1.15
@@ -261,24 +261,24 @@
class StatePair:
"""Contains a State Plus Reason"""
- def __init__(self,state=STATUS_UNSET,reason=REASON_UNSET):
- self.state=state
+ def __init__(self,status=STATUS_UNSET,reason=REASON_UNSET):
+ self.status=status
self.reason=reason
def __repr__(self):
return str(self)
def __str__(self):
- result=stateName(self.state)
+ result=stateName(self.status)
if not self.reason == REASON_UNSET:
result += ":" + reasonString(self.reason)
return result
def __eq__(self,other):
- return self.state == other.state and self.reason == other.reason
+ return self.status == other.status and self.reason == other.reason
def __cmp__(self,other):
- cmp = self.state < other.state
+ cmp = self.status < other.status
if not cmp: cmp = self.reason < other.reason
return cmp
@@ -334,8 +334,8 @@
else:
print indent + ' ' + 'Tree Done...'
- def setState(self,state,reason=REASON_UNSET,cause=None):
- self.status=state
+ def setState(self,status,reason=REASON_UNSET,cause=None):
+ self.status=status
self.reason=reason
self.cause=cause
@@ -346,7 +346,7 @@
if not states: states=[]
pair=self.getStatePair()
# Add state, if not already there
- if not stateUnset(pair.state) and not pair in states: \
+ if not stateUnset(pair.status) and not pair in states: \
states.append(pair)
# Subbordinates
for ctxt in self:
@@ -358,18 +358,18 @@
summary=Summary(0,0,0,0,[])
# Stand up and be counted
- if not stateUnit(self.state):
- if stateOk(self.state):
+ if not stateUnit(self.status):
+ if stateOk(self.status):
summary.successes+=1
- elif STATUS_PREREQ_FAILURE == self.state:
+ elif STATUS_PREREQ_FAILURE == self.status:
summary.prereqs+=1
- elif STATUS_FAILED == self.state:
+ elif STATUS_FAILED == self.status:
summary.failures+=1
else:
summary.other+=1
# Add state, if not already there
- if not stateUnset(pair.state) and not pair in summary.statepairs: \
+ if not stateUnset(pair.status) and not pair in summary.statepairs: \
summary.statepairs.append(pair)
# Subordinates
@@ -378,7 +378,7 @@
return summary;
- def propagateErrorState(self,state,reason=REASON_UNSET,cause=None):
+ def propagateErrorState(self,status,reason=REASON_UNSET,cause=None):
#
# If no-one else to point the finger at ...
# ... step up.
@@ -390,10 +390,10 @@
#
if stateUnsetOrOk(self.status):
# Modify self
- self.setState(state,reason,cause)
+ self.setState(status,reason,cause)
# .. then push this error down
for ctxt in self:
- ctxt.propagateErrorState(state,reason,cause)
+ ctxt.propagateErrorState(status,reason,cause)
def elapsedSecs(self):
elapsedSecs=self.worklist.elapsedSecs()
@@ -523,7 +523,7 @@
return round(fogFactor/fogFactors,2)
- def propagateErrorState(self,state,reason=REASON_UNSET,cause=None):
+ def propagateErrorState(self,status,reason=REASON_UNSET,cause=None):
#
# If no-one else to point the finger at ...
# ... step up.
@@ -533,12 +533,12 @@
# Do NOT over-write a preexisting condition
if stateUnsetOrOk(self.status):
# Call the superclass behaviour
- Context.propagateErrorState(self,state,reason,cause)
+ Context.propagateErrorState(self,status,reason,cause)
#
#
#
- message = lower(stateName(state))
+ message = lower(stateName(status))
if not REASON_UNSET == reason:
message += " with reason " + lower(reasonString(reason))
self.addError(capitalize(message))
1.10 +4 -5 jakarta-gump/python/gump/logic.py
Index: logic.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/logic.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- logic.py 29 Sep 2003 22:50:07 -0000 1.9
+++ logic.py 29 Sep 2003 23:54:50 -0000 1.10
@@ -281,8 +281,7 @@
outputs=[]
for i in range(0,len(project.jar)):
jar=os.path.normpath(project.jar[i].path)
- outputs.append(jar)
-
+ outputs.append(jar)
return outputs
def hasOutputs(project):
@@ -382,7 +381,7 @@
log.error("Missing Jar [" + str(jarpath) + "] on *packaged*
[" + pctxt.name + "]")
if outputsOk:
- pctxt.state=STATUS_COMPLETE
+ pctxt.status=STATUS_COMPLETE
pctxt.reason=REASON_PACKAGE
#
@@ -427,7 +426,7 @@
# will be asssumed to be packages.
#
pctxt=context.getProjectContextForProject(project)
- pctxt.state=STATUS_COMPLETE
+ pctxt.status=STATUS_COMPLETE
pctxt.reason=REASON_PACKAGE
else:
allPackaged=0
@@ -438,7 +437,7 @@
packageCount+=1
if allPackaged:
- mctxt.state=STATUS_COMPLETE
+ mctxt.status=STATUS_COMPLETE
mctxt.reason=REASON_PACKAGE
mctxt.addInfo("\'Packaged\' Module. (Packaged projects: " + \
str(packageCount) + '.)')
1.52 +3 -3 jakarta-gump/python/gump/document.py
Index: document.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/document.py,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- document.py 29 Sep 2003 23:10:12 -0000 1.51
+++ document.py 29 Sep 2003 23:54:50 -0000 1.52
@@ -294,7 +294,7 @@
#
todos=0
for pair in mctxt.aggregateStates():
- if pair.state==STATUS_FAILED:
+ if pair.status==STATUS_FAILED:
todos=1
if not todos: continue
@@ -482,7 +482,7 @@
#
todos=0
for pair in pctxt.aggregateStates():
- if pair.state==STATUS_FAILED:
+ if pair.status==STATUS_FAILED:
todos=1
if not todos: continue
@@ -1098,7 +1098,7 @@
def getStatePairIcon(pair,depth=0):
- sname=stateName(pair.state)
+ sname=stateName(pair.status)
rstring=reasonString(pair.reason)
description=sname
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]