Ticket #154 (new defect)

Opened 1 year ago

Last modified 2 months ago

No way to specify http request log file used by WebStatus

Reported by: exarkun Assigned to:
Priority: major Milestone: undecided
Component: other Version: 0.7.6
Keywords: review Cc:

Description

WebStatus? has a ton of logic in it, much of which is nice and desirable. Unfortunately, if one wants to customize part of it, some nasty hacks are involved, or a lot of code duplication. For example, since the Site is instantiated halfway through __init__, if one wants to pass any extra arguments to it, one is more or less out of luck. It'd be nice if the way the site is instantiated could be controlled more directly.

Attachments

proposed-patch-for-ticket-154.patch (1.5 kB) - added by ashcrow on 09/19/08 12:29:07.

Change History

09/19/08 12:29:07 changed by ashcrow

  • attachment proposed-patch-for-ticket-154.patch added.

09/19/08 12:29:48 changed by ashcrow

Is this what you are looking for?

hunk ./buildbot/status/web/baseweb.py 363
-                       public_html="public_html"):
+                       public_html="public_html", site=None):
hunk ./buildbot/status/web/baseweb.py 403
+        @type  site: None or L{twisted.web.server.Site}
+        @param site: Use this if you want to define your own object instead of
+                     using the default.
hunk ./buildbot/status/web/baseweb.py 407
-
hunk ./buildbot/status/web/baseweb.py 420
-        # this will be replaced once we've been attached to a parent (and
-        # thus have a basedir and can reference BASEDIR)
-        root = static.Data("placeholder", "text/plain")
-        self.site = server.Site(root)
+        # If we were given a site object, go ahead and use it.
+        if site:
+            self.site = site
+        else:
+            # this will be replaced once we've been attached to a parent (and
+            # thus have a basedir and can reference BASEDIR)
+            root = static.Data("placeholder", "text/plain")
+            self.site = server.Site(root)
+

09/20/08 11:07:41 changed by ashcrow

  • keywords set to review.