ajack 2004/07/12 08:18:04
Modified: python/gump/model project.py
python/gump/notify logic.py notifier.py
python/gump/core commandLine.py gumprun.py
python/gump/update updater.py
python/gump/build builder.py
Log:
Halved the work done after a module update or project build (the events were being
dispatched twice!)
Worked on notification (the two e-mails were a tipoff to above).
Revision Changes Path
1.87 +1 -2 gump/python/gump/model/project.py
Index: project.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/project.py,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -r1.86 -r1.87
--- project.py 8 Jul 2004 20:33:07 -0000 1.86
+++ project.py 12 Jul 2004 15:18:04 -0000 1.87
@@ -434,10 +434,9 @@
fromaddr=getDomAttributeValue(notifyEntry,'from',workspace.email)
self.notifys.append(
AddressPair(
- getStringFromUnicode(toaddr), \
+ getStringFromUnicode(toaddr),
getStringFromUnicode(fromaddr)))
-
# Build Dependencies Map [including depends from
<ant|maven/<property/<depend
if not packaged:
(badDepends, badOptions) = self.importDependencies(workspace)
1.4 +7 -4 gump/python/gump/notify/logic.py
Index: logic.py
===================================================================
RCS file: /home/cvs/gump/python/gump/notify/logic.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- logic.py 8 Jul 2004 20:33:06 -0000 1.3
+++ logic.py 12 Jul 2004 15:18:04 -0000 1.4
@@ -66,10 +66,13 @@
if not STATE_PREREQ_FAILED == stats.previousState:
if stats.getTotalRuns() > 1:
notification=PositiveNotification(self.run,entity)
- else:
- if self.run.getOptions().isOfficial() \
- and entity.containsNasties():
- notification=NegativeNotification(self.run,entity,'Contains
warning/error annotations.')
+ # :TODO:
+ # 1) Too verbose
+ # 2) Need a warning type w/o the 'outstanding ...'
+ # else:
+ # if self.run.getOptions().isOfficial() \
+ # and entity.containsNasties():
+ # notification=NegativeNotification(self.run,entity,' contains
warning/error annotations')
#elif entity.isPrereqFailed():
# if (stats.sequenceInState == 1):
1.7 +5 -5 gump/python/gump/notify/notifier.py
Index: notifier.py
===================================================================
RCS file: /home/cvs/gump/python/gump/notify/notifier.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- notifier.py 8 Jul 2004 20:33:06 -0000 1.6
+++ notifier.py 12 Jul 2004 15:18:04 -0000 1.7
@@ -206,11 +206,11 @@
if self.unsent: return 1
return 0
-
def notifyWorkspace(self,notification):
""" Notify for the workspace """
content=notification.resolveContent(self.resolver, self.id)
+ self.id+=1
subject=self.workspace.prefix+': Gump Workspace ' + self.workspace.getName()
@@ -223,6 +223,7 @@
# Form the content...
content=notification.resolveContent(self.resolver, self.id)
+ self.id+=1
# Form the subject
subject=self.workspace.prefix+ \
@@ -240,6 +241,7 @@
# Form the content...
#
content=notification.resolveContent(self.resolver, self.id)
+ self.id+=1
# Form the subject
subject=self.workspace.prefix+': ' \
@@ -295,10 +297,8 @@
sent=False
try:
- log.info('Send Notify e-mail (#' + `self.id` + ') :\n To: ' +
str(toaddr) + \
- '\n From: ' + str(fromaddr) + \
- '\n Subject: ' + str(subject))
- self.id+=1
+ log.info('Send Notify To: ' + str(toaddr) +
+ ' From: ' + str(fromaddr) + ' Subject: ' + str(subject))
# Form the user visable part ...
email=EmailMessage( toaddrs,
1.11 +13 -14 gump/python/gump/core/commandLine.py
Index: commandLine.py
===================================================================
RCS file: /home/cvs/gump/python/gump/core/commandLine.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- commandLine.py 8 Jul 2004 20:33:09 -0000 1.10
+++ commandLine.py 12 Jul 2004 15:18:04 -0000 1.11
@@ -85,42 +85,42 @@
if arg in ['-d','--debug']:
removers.append(arg)
log.info('Setting log level to DEBUG')
- self.options.setVerbose(1) # Sub-set of debug
- self.options.setDebug(1)
+ self.options.setVerbose(True) # Sub-set of debug
+ self.options.setDebug(True)
log.setLevel(logging.DEBUG)
elif arg in ['-v','--verbose']:
removers.append(arg)
log.info('Setting log level to VERBOSE')
- self.options.setVerbose(1)
+ self.options.setVerbose(True)
# :TODO: VERBOSE doesn't exist within logging...
log.setLevel(logging.DEBUG)
elif arg in ['-l','--latest']:
removers.append(arg)
- self.options.setCache(0)
- self.options.setQuick(0)
+ self.options.setCache(False)
+ self.options.setQuick(False)
log.info('Absolute Latest [no use of cache, don\'t skip stack]')
elif arg in ['-D','--dated']:
removers.append(arg)
#
# Dated means add the date to the log dir...
#
- self.options.setDated(1)
+ self.options.setDated(True)
log.info('Dated Operation (add date to log dir)')
elif arg in ['-O','--official']:
removers.append(arg)
- self.options.setOfficial(1)
+ self.options.setOfficial(True)
log.info('Official run (publish notifications, etc.)')
elif arg in ['-c','--cache']:
removers.append(arg)
- self.options.setCache(1)
+ self.options.setCache(True)
log.info('Use cache (do not download latest over HTTP).')
elif arg in ['-t','--text']:
removers.append(arg)
- self.options.setText(1)
+ self.options.setText(True)
log.info('Use text (not xdocs).')
elif arg in ['-x','--xdocs']:
removers.append(arg)
- self.options.setXDocs(1)
+ self.options.setXDocs(True)
log.info('Output xdocs (not XHTML).')
# Remove
@@ -156,15 +156,14 @@
#sys.exit(1)
self.args.append('*')
- # Remove
- for arg in removers:
- argv.remove(arg)
+ # Remove those used
+ for arg in removers: argv.remove(arg)
for arg in argv:
log.debug("Unused command line argument : " + arg)
for arg in self.args:
- log.debug("Argument : " + arg)
+ log.debug("Produced Argument : " + arg)
def getArguments(self):
return self.args
1.11 +1 -1 gump/python/gump/core/gumprun.py
Index: gumprun.py
===================================================================
RCS file: /home/cvs/gump/python/gump/core/gumprun.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- gumprun.py 8 Jul 2004 20:33:09 -0000 1.10
+++ gumprun.py 12 Jul 2004 15:18:04 -0000 1.11
@@ -713,7 +713,7 @@
"""
log.debug('Dispatch Event : ' + `event`)
for actor in self.actors:
- #log.debug('Dispatch Event : ' + `event` + ' to ' + `actor`)
+ log.debug('Dispatch Event : ' + `event` + ' to ' + `actor`)
actor._processEvent(event)
inspectGarbageCollection(`event`)
1.5 +0 -2 gump/python/gump/update/updater.py
Index: updater.py
===================================================================
RCS file: /home/cvs/gump/python/gump/update/updater.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- updater.py 8 Jul 2004 20:33:09 -0000 1.4
+++ updater.py 12 Jul 2004 15:18:04 -0000 1.5
@@ -135,8 +135,6 @@
if ok:
self.syncModule(module)
- # Generate/process the module event...
- self.run.generateEvent(module)
def syncModule(self,module):
1.7 +1 -5 gump/python/gump/build/builder.py
Index: builder.py
===================================================================
RCS file: /home/cvs/gump/python/gump/build/builder.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- builder.py 9 Jul 2004 18:20:36 -0000 1.6
+++ builder.py 12 Jul 2004 15:18:04 -0000 1.7
@@ -187,11 +187,7 @@
if project.isFailed():
log.warn('Failed to build project #[' + `project.getPosition()` + '] :
[' + project.getName() + '], state:' \
- + project.getStateDescription())
-
- # Generate/process the project event...
- self.run.generateEvent(project)
-
+ + project.getStateDescription())
def performDelete(self,project,delete,index=0):
""" Return the delete command for a <delete entry """
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]