[Buildbot-commits] buildbot/buildbot/status/web baseweb.py, 1.23, 1.24

Brian Warner warner at users.sourceforge.net
Sun Sep 30 01:04:14 UTC 2007


Update of /cvsroot/buildbot/buildbot/buildbot/status/web
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25055/buildbot/status/web

Modified Files:
	baseweb.py 
Log Message:
[project @ test_webparts: make sure WebStatus works after a reload]

Original author: warner at lothar.com
Date: 2007-09-30 01:03:46+00:00

Index: baseweb.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- baseweb.py	28 Sep 2007 09:33:40 -0000	1.23
+++ baseweb.py	30 Sep 2007 01:04:12 -0000	1.24
@@ -409,6 +409,15 @@
         self.footer = FOOTER
         self.template_values = {}
 
+        # TODO: browsers will cache connections, and if we've recently
+        # reloaded the config file, a browser might still be talking to the
+        # previous Site, which will work for some things, but will break when
+        # they try to reach through our .parent attribute (usually via
+        # HtmlResource.getStatus(), which does
+        # request.site.buildbot_service.parent). I don't know of a good way
+        # to deal with this.. maybe the Site has some list of current
+        # connections which we can crawl through and terminate?
+
         if self.http_port is not None:
             s = strports.service(self.http_port, self.site)
             s.setServiceParent(self)
@@ -431,11 +440,13 @@
 
     def __repr__(self):
         if self.http_port is None:
-            return "<WebStatus on path %s>" % self.distrib_port
+            return "<WebStatus on path %s at %s>" % (self.distrib_port,
+                                                     hex(id(self)))
         if self.distrib_port is None:
-            return "<WebStatus on port %s>" % self.http_port
-        return "<WebStatus on port %s and path %s>" % (self.http_port,
-                                                       self.distrib_port)
+            return "<WebStatus on port %s at %s>" % (self.http_port,
+                                                     hex(id(self)))
+        return ("<WebStatus on port %s and path %s at %s>" %
+                (self.http_port, self.distrib_port, hex(id(self))))
 
     def setServiceParent(self, parent):
         service.MultiService.setServiceParent(self, parent)





More information about the Commits mailing list