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 2003/10/15 23:07:44 UTC
cvs commit: jakarta-gump/python/gump nag.py document.py
ajack 2003/10/15 14:07:43
Modified: python/gump nag.py document.py
Log:
A whack at extracting real nag.to and nag.from.
Revision Changes Path
1.7 +25 -17 jakarta-gump/python/gump/nag.py
Index: nag.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/nag.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- nag.py 15 Oct 2003 20:40:02 -0000 1.6
+++ nag.py 15 Oct 2003 21:07:43 -0000 1.7
@@ -78,21 +78,24 @@
if STATUS_FAILED==context.status:
nagWorkspace(workspace,context)
- for (mname,mctxt) in context.subcontexts.iteritems():
+ for mctxt in context:
if not STATUS_SUCCESS == mctxt.status:
+ mname=mctxt.name
if Module.list.has_key(mname):
# :TODO: Something doesn't work w/ this.
# if moduleFilterList and not mname in moduleFilterList: continue
module=Module.list[mname]
- for (pname,pctxt) in mctxt.subcontexts.iteritems():
+ for pctxt in mctxt:
+ pname=pctxt.name
if STATUS_FAILED == pctxt.status:
- # :TODO: Something doesn't work w/ this.
- # if projectFilterList and not pctxt.project in projectFilterList: continue
- project=Project.list[pname]
- if project.nag:
- nagProject(workspace,context,module,mctxt,project,pctxt)
- else:
- log.error("Project naggable w/ nowhere to nag")
+ if Project.list.has_key(pname):
+ # :TODO: Something doesn't work w/ this.
+ # if projectFilterList and not pctxt.project in projectFilterList: continue
+ project=Project.list[pname]
+ if project.nag:
+ nagProject(workspace,context,module,mctxt,project,pctxt)
+ else:
+ log.error("Project naggable w/ nowhere to nag")
def nagWorkspace(workspace,context):
""" Nag for the workspace """
@@ -112,14 +115,19 @@
content+=getContent(pctxt,"Project: " + project.name + "\n" )
content+="----------------------------------------------------\n"
- #
- # Form and send the e-mail...
- #
- email=EmailMessage(workspace.prefix+':'+module.name+'/'+project.name+' '+stateName(pctxt.status),content)
- toaddr=project.nag.toaddr or workspace.mailinglist
- fromaddr=project.nag.fromaddr or workspace.mailinglist
- toaddrs=[ toaddr or workspace.mailinglist ]
- mail(toaddrs,fromaddr,email,workspace.mailserver)
+ for nagEntry in project.nag:
+ #
+ # Form and send the e-mail...
+ #
+ email=EmailMessage(workspace.prefix+': '+module.name+'/'+project.name+' '+stateName(pctxt.status),content)
+ toaddr=getattr(nagEntry,'to',workspace.mailinglist)
+ fromaddr=getattr(nagEntry,'from',workspace.mailinglist)
+
+ # We send to a list, but a list of one is fine..
+ toaddrs=[ toaddr ]
+
+ # Fire ...
+ mail(toaddrs,fromaddr,email,workspace.mailserver)
def getContent(context,message=''):
content=''
1.74 +9 -0 jakarta-gump/python/gump/document.py
Index: document.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/document.py,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- document.py 15 Oct 2003 20:40:02 -0000 1.73
+++ document.py 15 Oct 2003 21:07:43 -0000 1.74
@@ -661,7 +661,16 @@
addItemXDoc(x,"First Success: ", str(stats.first))
if stats.last:
addItemXDoc(x,"Last Success: ", str(stats.last))
+
+ # Display nag information
+ for nagEntry in project.nag:
+ toaddr=getattr(nagEntry,'to',workspace.mailinglist)
+ fromaddr=getattr(nagEntry,'from',workspace.mailinglist)
+ addItemXDoc(x,"Nag To: ", toaddr)
+ addItemXDoc(x,"Nag From: ", toaddr)
+
endListXDoc(x)
+
endSectionXDoc(x)
documentProjectContextList(x,"Project Dependencies",projectcontext.depends)