def test_literal(self):
c = self.create_fake_client()
- lcr = web_check_results.LiteralCheckResults(c)
+ lcr = web_check_results.LiteralCheckResultsRenderer(c)
d = self.render1(lcr)
def _check(html):
}
cr.set_data(data)
- w = web_check_results.CheckResults(c, cr)
+ w = web_check_results.CheckResultsRenderer(c, cr)
html = self.render2(w)
s = self.remove_tags(html)
self.failUnlessIn("File Check Results for SI=2k6avp", s) # abbreviated
crr.post_repair_results = post_cr
crr.repair_attempted = False
- w = web_check_results.CheckAndRepairResults(c, crr)
+ w = web_check_results.CheckAndRepairResultsRenderer(c, crr)
html = self.render2(w)
s = self.remove_tags(html)
self.failUnlessEqual(j["post-repair-results"]["summary"], "worse")
d.addCallback(_got_json)
- w2 = web_check_results.CheckAndRepairResults(c, None)
+ w2 = web_check_results.CheckAndRepairResultsRenderer(c, None)
d.addCallback(lambda ignored: self.render_json(w2))
def _got_lit_results(data):
j = simplejson.loads(data)
target = target + "?output=%s" % output
return T.a(href=target)[si_s]
-class LiteralCheckResults(rend.Page, ResultsBase):
+class LiteralCheckResultsRenderer(rend.Page, ResultsBase):
docFactory = getxmlfile("literal-check-results.xhtml")
def __init__(self, client):
return T.div[T.a(href=return_to)["Return to file/directory."]]
return ""
-class CheckResults(CheckerBase, rend.Page, ResultsBase):
+class CheckResultsRenderer(CheckerBase, rend.Page, ResultsBase):
docFactory = getxmlfile("check-results.xhtml")
def __init__(self, client, results):
cr = self._render_results(ctx, data)
return ctx.tag[cr]
-class CheckAndRepairResults(CheckerBase, rend.Page, ResultsBase):
+class CheckAndRepairResultsRenderer(CheckerBase, rend.Page, ResultsBase):
docFactory = getxmlfile("check-and-repair-results.xhtml")
def __init__(self, client, results):
return ""
-class DeepCheckResults(rend.Page, ResultsBase, ReloadMixin):
+class DeepCheckResultsRenderer(rend.Page, ResultsBase, ReloadMixin):
docFactory = getxmlfile("deep-check-results.xhtml")
def __init__(self, client, monitor):
si = base32.a2b(name)
r = self.monitor.get_status()
try:
- return CheckResults(self.client,
- r.get_results_for_storage_index(si))
+ return CheckResultsRenderer(self.client,
+ r.get_results_for_storage_index(si))
except KeyError:
raise WebError("No detailed results for SI %s" % html.escape(name),
http.NOT_FOUND)
runtime = time.time() - req.processing_started_timestamp
return ctx.tag["runtime: %s seconds" % runtime]
-class DeepCheckAndRepairResults(rend.Page, ResultsBase, ReloadMixin):
+class DeepCheckAndRepairResultsRenderer(rend.Page, ResultsBase, ReloadMixin):
docFactory = getxmlfile("deep-check-and-repair-results.xhtml")
def __init__(self, client, monitor):
# /operation/$OPHANDLE/$STORAGEINDEX provides detailed information
# about a specific file or directory that was checked
si = base32.a2b(name)
- r = self.monitor.get_status()
+ s = self.monitor.get_status()
try:
- return CheckAndRepairResults(self.client,
- r.get_results_for_storage_index(si))
+ results = s.get_results_for_storage_index(si)
+ return CheckAndRepairResultsRenderer(self.client, results)
except KeyError:
raise WebError("No detailed results for SI %s" % html.escape(name),
http.NOT_FOUND)
get_format, get_mutable_type
from allmydata.web.filenode import ReplaceMeMixin, \
FileNodeHandler, PlaceHolderNodeHandler
-from allmydata.web.check_results import CheckResults, \
- CheckAndRepairResults, DeepCheckResults, DeepCheckAndRepairResults, \
- LiteralCheckResults
+from allmydata.web.check_results import CheckResultsRenderer, \
+ CheckAndRepairResultsRenderer, DeepCheckResultsRenderer, \
+ DeepCheckAndRepairResultsRenderer, LiteralCheckResultsRenderer
from allmydata.web.info import MoreInfo
from allmydata.web.operations import ReloadMixin
from allmydata.web.check_results import json_check_results, \
def _maybe_literal(self, res, Results_Class):
if res:
return Results_Class(self.client, res)
- return LiteralCheckResults(self.client)
+ return LiteralCheckResultsRenderer(self.client)
def _POST_check(self, req):
# check this directory
add_lease = boolean_of_arg(get_arg(req, "add-lease", "false"))
if repair:
d = self.node.check_and_repair(Monitor(), verify, add_lease)
- d.addCallback(self._maybe_literal, CheckAndRepairResults)
+ d.addCallback(self._maybe_literal, CheckAndRepairResultsRenderer)
else:
d = self.node.check(Monitor(), verify, add_lease)
- d.addCallback(self._maybe_literal, CheckResults)
+ d.addCallback(self._maybe_literal, CheckResultsRenderer)
return d
def _start_operation(self, monitor, renderer, ctx):
add_lease = boolean_of_arg(get_arg(ctx, "add-lease", "false"))
if repair:
monitor = self.node.start_deep_check_and_repair(verify, add_lease)
- renderer = DeepCheckAndRepairResults(self.client, monitor)
+ renderer = DeepCheckAndRepairResultsRenderer(self.client, monitor)
else:
monitor = self.node.start_deep_check(verify, add_lease)
- renderer = DeepCheckResults(self.client, monitor)
+ renderer = DeepCheckResultsRenderer(self.client, monitor)
return self._start_operation(monitor, renderer, ctx)
def _POST_stream_deep_check(self, ctx):
boolean_of_arg, get_arg, should_create_intermediate_directories, \
MyExceptionHandler, parse_replace_arg, parse_offset_arg, \
get_format, get_mutable_type
-from allmydata.web.check_results import CheckResults, \
- CheckAndRepairResults, LiteralCheckResults
+from allmydata.web.check_results import CheckResultsRenderer, \
+ CheckAndRepairResultsRenderer, LiteralCheckResultsRenderer
from allmydata.web.info import MoreInfo
class ReplaceMeMixin:
def _maybe_literal(self, res, Results_Class):
if res:
return Results_Class(self.client, res)
- return LiteralCheckResults(self.client)
+ return LiteralCheckResultsRenderer(self.client)
def _POST_check(self, req):
verify = boolean_of_arg(get_arg(req, "verify", "false"))
add_lease = boolean_of_arg(get_arg(req, "add-lease", "false"))
if repair:
d = self.node.check_and_repair(Monitor(), verify, add_lease)
- d.addCallback(self._maybe_literal, CheckAndRepairResults)
+ d.addCallback(self._maybe_literal, CheckAndRepairResultsRenderer)
else:
d = self.node.check(Monitor(), verify, add_lease)
- d.addCallback(self._maybe_literal, CheckResults)
+ d.addCallback(self._maybe_literal, CheckResultsRenderer)
return d
def render_DELETE(self, ctx):