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 2004/06/18 16:58:17 UTC
cvs commit: gump/python/gump/model misc.py workspace.py
ajack 2004/06/18 07:58:17
Modified: template/xhtml/css Tag: CleanUp style.css
python/gump/runner Tag: CleanUp runner.py
python/gump/document/xdocs Tag: CleanUp xdoc.py
documenter.py
python/gump/notify Tag: CleanUp notifier.py
python/gump/core Tag: CleanUp gumprun.py
python/gump/test Tag: CleanUp loading.py xdocs.py
python/gump/model Tag: CleanUp misc.py workspace.py
Log:
Tweaks & Fixes.
Revision Changes Path
No revision
No revision
1.1.2.3 +1 -1 gump/template/xhtml/css/Attic/style.css
Index: style.css
===================================================================
RCS file: /home/cvs/gump/template/xhtml/css/Attic/style.css,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- style.css 16 Jun 2004 23:38:31 -0000 1.1.2.2
+++ style.css 18 Jun 2004 14:58:16 -0000 1.1.2.3
@@ -1 +1 @@
-img { border: 0 }
HR { color: #8EB4D9; height: 1px; text-align: center; width: 90%; position:
relative }
# Annotations
.DEBUG { bgcolor: #000000 }
.INFO { bgcolor: #00FF00 }
.WARN { bgcolor: #00FFFF }
.ERROR { bgcolor: #FF0000 }
# State
.SUCCESS { bgcolor: #00FF00 }
.FAILED { bgcolor: #FF0000 }
\ No newline at end of file
+img { border: 0 }
HR { color: #8EB4D9; height: 1px; text-align: center; width: 90%; position:
relative }
# Annotations
.DEBUG { background-color: #000000 }
.INFO { background-color: #00FF00 }
.WARN { background-color: #00FFFF }
.ERROR { background-color: #FF0000 }
# State
.SUCCESS { background-color: #00FF00 }
.FAILED { background-color: #FF0000 }
.PREREQFAILED { background-color: #00FFFF }
\ No newline at end of file
No revision
No revision
1.5.2.5 +1 -2 gump/python/gump/runner/runner.py
Index: runner.py
===================================================================
RCS file: /home/cvs/gump/python/gump/runner/runner.py,v
retrieving revision 1.5.2.4
retrieving revision 1.5.2.5
diff -u -r1.5.2.4 -r1.5.2.5
--- runner.py 16 Jun 2004 17:50:39 -0000 1.5.2.4
+++ runner.py 18 Jun 2004 14:58:16 -0000 1.5.2.5
@@ -127,12 +127,11 @@
self.run.getOptions().setResolver(documenter.getResolver())
self.run.registerActor(documenter)
-
# Syndicate once documented
self.run.registerActor(Syndicator(self.run))
# Notify last
- if self.run.getOptions().isNotify():
+ if self.run.getOptions().isNotify() and self.run.getWorkspace().isNotify():
self.run.registerActor(Notifier(self.run))
def finalize(self):
No revision
No revision
1.2.2.8 +10 -7 gump/python/gump/document/xdocs/xdoc.py
Index: xdoc.py
===================================================================
RCS file: /home/cvs/gump/python/gump/document/xdocs/xdoc.py,v
retrieving revision 1.2.2.7
retrieving revision 1.2.2.8
diff -u -r1.2.2.7 -r1.2.2.8
--- xdoc.py 17 Jun 2004 19:23:26 -0000 1.2.2.7
+++ xdoc.py 18 Jun 2004 14:58:16 -0000 1.2.2.8
@@ -575,16 +575,16 @@
XDocPiece.__init__(self,context,config)
if text:
self.createText(text)
-
+
def start(self):
if self.config.isXhtml():
- self.context.writeLineIndented('<p class="NOTE">')
+ self.context.writeLineIndented('<table><tr><td class="WARN"><p>')
else:
- self.context.writeLineIndented('<note>')
+ self.context.writeLineIndented('<note>')
def end(self):
if self.config.isXhtml():
- self.context.writeLine('</p>')
+ self.context.writeLine('</p></td></tr></table>')
else:
self.context.writeLine('</note>')
@@ -614,13 +614,13 @@
def start(self):
if self.config.isXhtml():
- self.context.writeLineIndented('<p class="WARN">')
+ self.context.writeLineIndented('<table><tr><td class="WARN"><p>')
else:
self.context.writeLineIndented('<warning>')
def end(self):
if self.config.isXhtml():
- self.context.writeLine('</p>')
+ self.context.writeLine('</p></td></tr></table>')
else:
self.context.writeLine('</warning>')
@@ -769,7 +769,8 @@
if isinstance(output,types.StringTypes):
self.xfile=output
log.debug("Documenting to file : [" + self.xfile + "] " + `self.config`)
- self.output=open(self.xfile, 'w')
+ # Open for writing with a decent sized buffer.
+ self.output=open(self.xfile, 'w', 4096)
else:
self.output=output
self.context=XDocContext(self.output)
@@ -833,6 +834,8 @@
# Probably ought do this higher up
self.unlink()
+ log.debug('Closed Documenting')
+
def createSection(self,title,transient=False):
return self.storePiece(XDocSection(self.createSubContext(transient),self.config,title))
1.9.2.16 +10 -5 gump/python/gump/document/xdocs/documenter.py
Index: documenter.py
===================================================================
RCS file: /home/cvs/gump/python/gump/document/xdocs/documenter.py,v
retrieving revision 1.9.2.15
retrieving revision 1.9.2.16
diff -u -r1.9.2.15 -r1.9.2.16
--- documenter.py 17 Jun 2004 20:05:52 -0000 1.9.2.15
+++ documenter.py 18 Jun 2004 14:58:16 -0000 1.9.2.16
@@ -742,7 +742,7 @@
# Modules...
#
modulesSection=document.createSection('Modules (in update order)')
- modulesTable=modulesSection.createTable(['Updated','Name','State','Duration\nin state','Last Modified','Notes'])
+ modulesTable=modulesSection.createTable(['Index','Updated','Name','State','Duration\nin state','Last Modified','Notes'])
mcount=0
for module in self.gumpSet.getCompletedModules():
@@ -752,6 +752,8 @@
moduleRow.createComment(module.getName())
self.setStyleFromState(moduleRow,module.getStatePair())
+
+ moduleRow.createData(module.getPositionIndex())
startData=moduleRow.createData(secsToTime(module.getStartSecs()))
self.setStyleFromState(startData,module.getStatePair())
@@ -778,7 +780,7 @@
# Projects...
#
projectsSection=document.createSection('Projects (in build order)')
- projectsTable=projectsSection.createTable(['Time','Name','State','Duration\nin state','Last Modified','Notes'])
+ projectsTable=projectsSection.createTable(['Index','Time','Name','State','Duration\nin state','Last Modified','Notes'])
pcount=0
for project in self.gumpSet.getCompletedProjects():
@@ -789,6 +791,8 @@
self.setStyleFromState(projectRow,project.getStatePair())
+ projectRow.createData(project.getPositionIndex())
+
projectRow.createData(secsToTime(project.getStartSecs()))
self.insertLink(project,self.workspace,projectRow.createData())
@@ -2024,9 +2028,10 @@
annotationsSection=xdocNode.createSection('Annotations')
- if annotatable.containsNasties() and not noWarn:
- annotationsSection.createWarning( \
- 'Some warnings and/or errors are present within these annotations.')
+ if not self.config.isXhtml():
+ if annotatable.containsNasties() and not noWarn:
+ annotationsSection.createWarning( \
+ 'Some warnings and/or errors are present within these annotations.')
annotationsTable=annotationsSection.createTable()
for note in annotations:
No revision
No revision
1.5.2.5 +7 -11 gump/python/gump/notify/notifier.py
Index: notifier.py
===================================================================
RCS file: /home/cvs/gump/python/gump/notify/notifier.py,v
retrieving revision 1.5.2.4
retrieving revision 1.5.2.5
diff -u -r1.5.2.4 -r1.5.2.5
--- notifier.py 14 Jun 2004 21:31:45 -0000 1.5.2.4
+++ notifier.py 18 Jun 2004 14:58:16 -0000 1.5.2.5
@@ -132,7 +132,6 @@
log.error("Failed to send notify e-mails for project " + project.getName()\
+ " : " + str(details), exc_info=1)
-
def addUnwanted(self,subject,content):
"""
Add this notification to the 'unwanted' list, since
@@ -240,9 +239,7 @@
#
content=notification.resolveContent(self.resolver)
- #
# Form the subject
- #
subject=self.workspace.prefix+': ' \
+ module.getName() + '/' +project.getName() \
+' '+lower(stateDescription(project.getState()))
@@ -294,19 +291,17 @@
#
toaddrs=[ toaddr ]
- sent=0
+ sent=False
try:
log.info('Send Notify e-mail:\n To: ' + str(toaddr) + \
'\n From: ' + str(fromaddr) + \
'\n Subject: ' + str(subject))
- #
# Form the user visable part ...
- #
- email=EmailMessage( toaddrs, \
- fromaddr, \
- subject, \
+ email=EmailMessage( toaddrs,
+ fromaddr,
+ subject,
content)
#print '-------------------------------------------------------------------'
@@ -318,10 +313,11 @@
# Fire ...
sent=mail(toaddrs,fromaddr,email, \
self.workspace.mailserver, \
- self.workspace.mailport)
+ self.workspace.mailport)
+
except Exception, details:
- sent=0
+ sent=False
log.error('Failed to send notify e-mail: ' + str(details), \
exc_info=1)
No revision
No revision
1.9.2.7 +21 -7 gump/python/gump/core/gumprun.py
Index: gumprun.py
===================================================================
RCS file: /home/cvs/gump/python/gump/core/gumprun.py,v
retrieving revision 1.9.2.6
retrieving revision 1.9.2.7
diff -u -r1.9.2.6 -r1.9.2.7
--- gumprun.py 17 Jun 2004 19:23:26 -0000 1.9.2.6
+++ gumprun.py 18 Jun 2004 14:58:17 -0000 1.9.2.7
@@ -205,6 +205,9 @@
def getModulesForProjectList(self,projects):
sequence=[]
+
+ moduleIndex=0
+
for project in projects:
# Some projects are outside of sequence
@@ -213,12 +216,15 @@
module = project.getModule()
if not module in sequence:
sequence.append(module)
- module.setPosition(len(sequence))
+
+ # Identify the index within overall sequence
+ moduleIndex+=1
+ module.setPosition(moduleIndex)
- # Hmm, see if we don't sort ...
- # would be nice to get in same order as
- # projects need
- # sequence.sort()
+ # Identify the size of overall sequence
+ moduleTotal=len(sequence)
+ for module in sequence:
+ module.setTotal(moduleTotal)
return sequence
@@ -277,10 +283,15 @@
"""Determine the build sequence for a given list of projects."""
todo=[]
sequence=[]
+
+ # These are the projects we are going to
for project in projects:
log.debug('Evaluate Seq for ['+project.getName()+']')
self.addToTodoList(project,todo)
+ projectIndex=0
+ projectTotal=len(projects)
+
while todo:
# one by one, remove the first ready project and append
# it to the sequence
@@ -290,8 +301,11 @@
todo.remove(todoProject)
if not todoProject in sequence:
sequence.append(todoProject)
- todoProject.setPosition(len(sequence))
- log.debug('#' + `todoProject.getPosition()` + ' -> ' + todoProject.getName())
+ projectIndex += 1
+ todoProject.setPosition(projectIndex)
+ todoProject.setTotal(projectTotal)
+
+ log.debug('Identify ' + todoProject.getName() + ' at position #' + `todoProject.getPosition()`)
#else:
# log.debug('Duplicate Result ['+todoProject.getName()+']')
foundSome=1
No revision
No revision
1.1.2.3 +4 -2 gump/python/gump/test/Attic/loading.py
Index: loading.py
===================================================================
RCS file: /home/cvs/gump/python/gump/test/Attic/loading.py,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- loading.py 16 Jun 2004 18:15:36 -0000 1.1.2.2
+++ loading.py 18 Jun 2004 14:58:17 -0000 1.1.2.3
@@ -16,7 +16,9 @@
"""
- Maven Testing
+
+ WorkspaceLoading Testing
+
"""
import os
@@ -39,7 +41,7 @@
UnitTestSuite.__init__(self)
def performLoad(self,file):
- return WorkSpaceLoader(True).load(file)
+ return WorkspaceLoader(True).load(file)
def testSimple1(self):
self.performLoad('gump/test/resources/simple1/standalone_workspace.xml')
1.1.2.3 +2 -2 gump/python/gump/test/Attic/xdocs.py
Index: xdocs.py
===================================================================
RCS file: /home/cvs/gump/python/gump/test/Attic/xdocs.py,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- xdocs.py 16 Jun 2004 17:50:40 -0000 1.1.2.2
+++ xdocs.py 18 Jun 2004 14:58:17 -0000 1.1.2.3
@@ -33,11 +33,11 @@
def testXhtml(self):
data=self.createXDoc('XHTML',True)
- print data
+ #print data
def testXDocs(self):
data=self.createXDoc('XDOCS',False)
- print data
+ #print data
def createXDoc(self,title,xhtml):
stream=StringIO.StringIO()
No revision
No revision
1.1.2.3 +4 -0 gump/python/gump/model/Attic/misc.py
Index: misc.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/Attic/misc.py,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- misc.py 17 Jun 2004 19:23:27 -0000 1.1.2.2
+++ misc.py 18 Jun 2004 14:58:17 -0000 1.1.2.3
@@ -36,18 +36,22 @@
self.total=-1
def setPosition(self,posn):
+ """ Set this object's position (within some sequence) """
self.posn=posn
def setTotal(self,total):
+ """ Set the total length of sequence """
self.total=total
def getPosition(self):
+ """ Return either a tuple or a position, dependent upon if total is set. Mainly for presentation in ``. """
if -1 != self.total:
return (self.posn,self.total)
if -1 != self.posn:
return self.posn
def getPositionIndex(self):
+ """ Get index in sequence """
return self.posn
class Resultable:
1.51.2.6 +6 -6 gump/python/gump/model/workspace.py
Index: workspace.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/workspace.py,v
retrieving revision 1.51.2.5
retrieving revision 1.51.2.6
diff -u -r1.51.2.5 -r1.51.2.6
--- workspace.py 14 Jun 2004 21:31:46 -0000 1.51.2.5
+++ workspace.py 18 Jun 2004 14:58:17 -0000 1.51.2.6
@@ -399,9 +399,9 @@
return hasDomAttribute(nag,'to')
def getNotifyToOverride(self):
- if not self.isNotify(): return False
- nag=self.getDomChild('nag')
- return getDomAttributeValue(nag,'to')
+ if self.isNotify():
+ nag=self.getDomChild('nag')
+ return getDomAttributeValue(nag,'to')
def hasNotifyFromOverride(self):
if not self.isNotify(): return False
@@ -409,9 +409,9 @@
return hasDomAttribute(nag,'from')
def getNotifyFromOverride(self):
- if not self.isNotify(): return False
- nag=self.getDomChild('nag')
- return getDomAttributeValue(nag,'from')
+ if self.isNotify():
+ nag=self.getDomChild('nag')
+ return getDomAttributeValue(nag,'from')
def getNotifyOverrides(self):
---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org