fix deep-stats results
This commit is contained in:
parent
7a36bdc523
commit
b4d9bfea15
|
@ -1295,18 +1295,24 @@ class DeepSizeResults(MultiFormatPage):
|
||||||
}
|
}
|
||||||
return json.dumps(status)
|
return json.dumps(status)
|
||||||
|
|
||||||
|
|
||||||
class DeepStatsResults(Resource):
|
class DeepStatsResults(Resource):
|
||||||
|
"""
|
||||||
|
Renders the results of a 'deep-stats' operation on a directory
|
||||||
|
capability.
|
||||||
|
"""
|
||||||
def __init__(self, client, monitor):
|
def __init__(self, client, monitor):
|
||||||
self.client = client
|
self.client = client
|
||||||
self.monitor = monitor
|
self.monitor = monitor
|
||||||
|
|
||||||
def renderHTTP(self, req):
|
def render(self, req):
|
||||||
# JSON only
|
# JSON only
|
||||||
req.setHeader("content-type", "text/plain")
|
req.setHeader("content-type", "text/plain")
|
||||||
s = self.monitor.get_status().copy()
|
s = self.monitor.get_status().copy()
|
||||||
s["finished"] = self.monitor.is_finished()
|
s["finished"] = self.monitor.is_finished()
|
||||||
return json.dumps(s, indent=1)
|
return json.dumps(s, indent=1)
|
||||||
|
|
||||||
|
|
||||||
@implementer(IPushProducer)
|
@implementer(IPushProducer)
|
||||||
class ManifestStreamer(dirnode.DeepStats):
|
class ManifestStreamer(dirnode.DeepStats):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue