[Buildbot-commits] buildbot/buildbot interfaces.py,1.38,1.39

Brian Warner warner at users.sourceforge.net
Sun Nov 27 00:46:15 UTC 2005


Update of /cvsroot/buildbot/buildbot/buildbot
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3585/buildbot

Modified Files:
	interfaces.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-444
Creator:  Brian Warner <warner at lothar.com>

fix StatusReceiver unsubscribe bug

	* buildbot/status/builder.py (BuildStepStatus.unsubscribe): make
	sure that unsubscribe works even if we never sent an ETA update.
	Also, don't explode on duplicate unsubscribe.
	(BuildStepStatus.addLog): make the convenience "return self"-added
	watcher automatically unsubscribe when the Step finishes.
	(BuildStatus.unsubscribe): same handle-duplicate-unsubscribe
	(BuildStatus.stepStarted): same auto-unsubscribe
	(BuilderStatus.buildStarted): same auto-unsubscribe

	* buildbot/interfaces.py (IStatusReceiver.buildStarted): document
	auto-unsubscribe
	(IStatusReceiver.stepStarted): same
	(IStatusReceiver.logStarted): same

	* buildbot/test/test_run.py (Status): move the Status test..
	* buildbot/test/test_status.py (Subscription): .. to here


Index: interfaces.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/interfaces.py,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- interfaces.py	5 Nov 2005 21:06:14 -0000	1.38
+++ interfaces.py	27 Nov 2005 00:46:13 -0000	1.39
@@ -726,6 +726,8 @@
         'self'). If it does so, stepStarted and stepFinished methods will be
         invoked on the object for the steps of this one build. This is a
         convenient way to subscribe to all build steps without missing any.
+        This receiver will automatically be unsubscribed when the build
+        finishes.
 
         It can also return a tuple of (IStatusReceiver, interval), in which
         case buildETAUpdate messages are sent ever 'interval' seconds, in
@@ -741,7 +743,8 @@
 
         This method may return an IStatusReceiver (it could even return
         'self'). If it does so, logStarted and logFinished methods will be
-        invoked on the object for logs created by this one step.
+        invoked on the object for logs created by this one step. This
+        receiver will be automatically unsubscribed when the step finishes.
 
         Alternatively, the method may return a tuple of an IStatusReceiver
         and an integer named 'updateInterval'. In addition to
@@ -762,7 +765,8 @@
 
         This method may return an IStatusReceiver (such as 'self'), in which
         case the target's logChunk method will be invoked as text is added to
-        the logfile. """
+        the logfile. This receiver will automatically be unsubsribed when the
+        log finishes."""
 
     def logChunk(build, step, log, channel, text):
         """Some text has been added to this log. 'channel' is 0, 1, or 2, as





More information about the Commits mailing list