From 8e37bb1ebbd0048791f72f5d04275bc289a6b3d7 Mon Sep 17 00:00:00 2001 From: Sajith Sasidharan Date: Wed, 3 Jun 2020 21:42:20 -0400 Subject: [PATCH] Make ResultsBase a base class of CheckResultsRendererElement --- src/allmydata/web/check_results.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/allmydata/web/check_results.py b/src/allmydata/web/check_results.py index 94b55d52d..c6a3d25ea 100644 --- a/src/allmydata/web/check_results.py +++ b/src/allmydata/web/check_results.py @@ -261,7 +261,7 @@ class CheckerBase(object): return "" -class CheckResultsRenderer(MultiFormatResource, ResultsBase): +class CheckResultsRenderer(MultiFormatResource): formatArgument = "output" @@ -276,7 +276,7 @@ class CheckResultsRenderer(MultiFormatResource, ResultsBase): self.r = ICheckResults(results) def render_HTML(self, req): - return renderElement(req, CheckResultsRendererElement(self.r)) + return renderElement(req, CheckResultsRendererElement(self.client, self.r)) def render_JSON(self, req): req.setHeader("content-type", "text/plain") @@ -284,12 +284,13 @@ class CheckResultsRenderer(MultiFormatResource, ResultsBase): return json.dumps(data, indent=1) + "\n" -class CheckResultsRendererElement(Element, CheckerBase): +class CheckResultsRendererElement(Element, CheckerBase, ResultsBase): loader = XMLFile(FilePath(__file__).sibling("check-results.xhtml")) - def __init__(self, r): + def __init__(self, client, r): super(CheckResultsRendererElement, self).__init__() + self.client = client # TODO: use a better name self.r = r