mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-12 16:02:43 +00:00
Make ResultsBase a base class of CheckResultsRendererElement
This commit is contained in:
parent
fea4e516f3
commit
8e37bb1ebb
@ -261,7 +261,7 @@ class CheckerBase(object):
|
|||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
class CheckResultsRenderer(MultiFormatResource, ResultsBase):
|
class CheckResultsRenderer(MultiFormatResource):
|
||||||
|
|
||||||
formatArgument = "output"
|
formatArgument = "output"
|
||||||
|
|
||||||
@ -276,7 +276,7 @@ class CheckResultsRenderer(MultiFormatResource, ResultsBase):
|
|||||||
self.r = ICheckResults(results)
|
self.r = ICheckResults(results)
|
||||||
|
|
||||||
def render_HTML(self, req):
|
def render_HTML(self, req):
|
||||||
return renderElement(req, CheckResultsRendererElement(self.r))
|
return renderElement(req, CheckResultsRendererElement(self.client, self.r))
|
||||||
|
|
||||||
def render_JSON(self, req):
|
def render_JSON(self, req):
|
||||||
req.setHeader("content-type", "text/plain")
|
req.setHeader("content-type", "text/plain")
|
||||||
@ -284,12 +284,13 @@ class CheckResultsRenderer(MultiFormatResource, ResultsBase):
|
|||||||
return json.dumps(data, indent=1) + "\n"
|
return json.dumps(data, indent=1) + "\n"
|
||||||
|
|
||||||
|
|
||||||
class CheckResultsRendererElement(Element, CheckerBase):
|
class CheckResultsRendererElement(Element, CheckerBase, ResultsBase):
|
||||||
|
|
||||||
loader = XMLFile(FilePath(__file__).sibling("check-results.xhtml"))
|
loader = XMLFile(FilePath(__file__).sibling("check-results.xhtml"))
|
||||||
|
|
||||||
def __init__(self, r):
|
def __init__(self, client, r):
|
||||||
super(CheckResultsRendererElement, self).__init__()
|
super(CheckResultsRendererElement, self).__init__()
|
||||||
|
self.client = client
|
||||||
# TODO: use a better name
|
# TODO: use a better name
|
||||||
self.r = r
|
self.r = r
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user