ajack 2004/02/11 16:24:16 Modified: python/gump/test nagging.py python/gump/output nag.py python/gump/document forrest.py Log: Tweaked nag verbiage... Revision Changes Path 1.3 +2 -2 jakarta-gump/python/gump/test/nagging.py Index: nagging.py =================================================================== RCS file: /home/cvs/jakarta-gump/python/gump/test/nagging.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- nagging.py 28 Jan 2004 22:54:49 -0000 1.2 +++ nagging.py 12 Feb 2004 00:24:16 -0000 1.3 @@ -92,10 +92,10 @@ # For all modules... for module in self.workspace.getModules(): print 'Get Content For Module : ' + module.getName() - print nagger.getContent(module,'test','Testing Module...') + print nagger.getNamedTypedContent(module,'test') for project in module.getProjects(): print 'Get Content For Project : ' + project.getName() - print nagger.getContent(project,'test','Testing Project...') + print nagger.getNamedTypedContent(project,'test') def testNagAddresses(self): 1.10 +42 -23 jakarta-gump/python/gump/output/nag.py Index: nag.py =================================================================== RCS file: /home/cvs/jakarta-gump/python/gump/output/nag.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- nag.py 30 Jan 2004 17:22:57 -0000 1.9 +++ nag.py 12 Feb 2004 00:24:16 -0000 1.10 @@ -78,7 +78,7 @@ from gump.net.mailer import * from gump.utils import * -LINE='------------------------------------------------- G U M P Y\n' +LINE='- - - - ----------------------------------------- G U M P Y\n' class AddressPair: def __init__(self,toAddr,fromAddr): @@ -184,7 +184,7 @@ def nagWorkspace(self): """ Nag for the workspace """ - content=self.getContent(self.workspace,'index',"There is a workspace problem... \n") + content=self.getGenericContent(self.workspace,'index',"There is a workspace problem... \n") self.sendEmail(self.workspace.mailinglist, \ self.workspace.email, \ @@ -197,7 +197,7 @@ # # Form the content... # - content+=self.getContent(module,'index',"Module: " + module.getName() + "\n") + content+=self.getNamedTypedContent(module,'index') # # Form the subject @@ -222,17 +222,11 @@ displayedProject=0 if not module.isSuccess(): displayedModule=1 - content+=self.getContent(module,'index',"Module: " + module.getName() + "\n") + content+=self.getNamedTypedContent(module,'index') if not project.isSuccess(): displayedProject=1 - content+=self.getContent(project, project.getName(), "Project: " + project.getName() + "\n" ) - - # No clue why this would happen, but fallback safe... - if not displayedModule and not displayedProject: - content+=self.getContent(module,'index',"Module: " + module.getName() + "\n") - content+="\n" - content+=self.getContent(project,project.getName(), "Project: " + project.getName() + "\n") + content+=self.getNamedTypedContent(project, project.getName() ) # # Form the subject @@ -301,7 +295,28 @@ self.addUnsent(subject,content) - def getContent(self,object,feedPrefix=None,message=None): + def getNamedTypedContent(self,object,feedPrefix=None,message=None): + content='To whom is may concern,\n\nThis is an automated request, but not an unsolicited one. Please see: http://jakarta.apache.org/gump/nagged.html\n\n' + + name=object.getName() + type=object.__class__.__name__ + affected=object.determineAffected() + + # Optional message + if message: + content+=message + + content += type + ': ' + name + ' has an issue affecting it\'s community integration.' + if affected: + content += ' This issue affects ' + `affected` + ' projects.\n' + else: + content += '\n' + + content += self.getGenericContent(object,feedPrefix) + + return content + + def getGenericContent(self,object,feedPrefix=None,message=None): content='' # Optional message @@ -311,23 +326,26 @@ # # Add State (and reason) # - content += "State: " + object.getStateDescription() + "\n" + content += "State: " + object.getStateDescription() if not object.hasReason(): - content += "Reason: " + object.getReasonDescription() + "\n" + content += ', Reason: ' + object.getReasonDescription() + '\n' + else: + content += '\n' # # Link them back here... # url=self.run.getOptions().getResolver().getUrl(object) - content += "URL: " + url + "\n" - + content += "\nThe URL for full details is: " + url + "\n" + content += '\n' + # # Add an info/error/etc... # if object.annotations: content += LINE - content += "\n\nAnnotations:\n" + content += "\n\nGump provided these annotations:\n\n" for note in object.annotations: content += (' - %s - %s\n' % (levelName(note.level), note.text)) @@ -336,14 +354,15 @@ # if object.worklist: content+="\n\n" + content += LINE + content += "\nGump performed this work:\n\n" for workitem in object.worklist: - content += LINE - content+=workitem.overview()+"\n" + content+=workitem.overview()+'\n\n' if feedPrefix: - content += LINE + content += '\n\nTo subscribe to this information via syndication:\n' # # Link them back here... 1.73 +9 -6 jakarta-gump/python/gump/document/forrest.py Index: forrest.py =================================================================== RCS file: /home/cvs/jakarta-gump/python/gump/document/forrest.py,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- forrest.py 11 Feb 2004 22:07:25 -0000 1.72 +++ forrest.py 12 Feb 2004 00:24:16 -0000 1.73 @@ -1283,19 +1283,22 @@ if not servers: return if len(servers) == 1: return # Assume this one. - serversSection=xdocNode.createSection('Servers') + serversSection=xdocNode.createSection('Servers') + serversSection.createParagraph('These links represent this location on other servers.') serversTable=serversSection.createTable() serverRow=serversTable.createRow() for server in servers: + # If we can resolve this object to a URL, then do if server.hasResolver(): serverRow.createData().createFork( \ server.getResolver().getUrl(linkable), \ - server.getName() ) + 'On ' + server.getName() ) else: + # Else just link to the server. if server.hasUrl(): serverRow.createData().createFork( \ server.getUrl(), \ - server.getName() ) + '~ ' + server.getName() ) def documentProperties(self,xdocNode,propertyContainer,title='Properties'):
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]