data = {"storage-index": "",
"results": {"healthy": True},
}
- return simplejson.dumps(data, indent=1)
+ return simplejson.dumps(data, indent=1) + "\n"
class CheckerResults(rend.Page, ResultsBase):
docFactory = getxmlfile("checker-results.xhtml")
def json(self, ctx):
inevow.IRequest(ctx).setHeader("content-type", "text/plain")
data = self._json_check_results(self.r)
- return simplejson.dumps(data, indent=1)
+ return simplejson.dumps(data, indent=1) + "\n"
def render_storage_index(self, ctx, data):
return self.r.get_storage_index_string()
def json(self, ctx):
inevow.IRequest(ctx).setHeader("content-type", "text/plain")
data = self._json_check_and_repair_results(self.r)
- return simplejson.dumps(data, indent=1)
+ return simplejson.dumps(data, indent=1) + "\n"
def render_storage_index(self, ctx, data):
return self.r.get_storage_index_string()
in self.r.get_all_results().items()
if not r.is_healthy() ]
data["stats"] = self.r.get_stats()
- return simplejson.dumps(data, indent=1)
+ return simplejson.dumps(data, indent=1) + "\n"
def render_root_storage_index(self, ctx, data):
return self.r.get_root_storage_index_string()
in self.r.get_all_results().items()
if not r.get_pre_repair_results().is_healthy() ]
data["stats"] = self.r.get_stats()
- return simplejson.dumps(data, indent=1)
+ return simplejson.dumps(data, indent=1) + "\n"
def render_root_storage_index(self, ctx, data):
return self.r.get_root_storage_index_string()
contents['rw_uri'] = drw_uri
contents['mutable'] = dirnode.is_mutable()
data = ("dirnode", contents)
- return simplejson.dumps(data, indent=1)
+ return simplejson.dumps(data, indent=1) + "\n"
d.addCallback(_got)
d.addCallback(text_plain, ctx)
return d
if rw_uri:
data[1]['rw_uri'] = rw_uri
data[1]['mutable'] = filenode.is_mutable()
- return text_plain(simplejson.dumps(data, indent=1), ctx)
+ return text_plain(simplejson.dumps(data, indent=1) + "\n", ctx)
def FileURI(ctx, filenode):
return text_plain(filenode.get_uri(), ctx)
announcement_summary[service_name] += 1
res["announcement_summary"] = announcement_summary
- return simplejson.dumps(res, indent=1)
+ return simplejson.dumps(res, indent=1) + "\n"
def data_version(self, ctx, data):
return get_package_versions_string()
"progress": s.get_progress(),
})
- return simplejson.dumps(data, indent=1)
+ return simplejson.dumps(data, indent=1) + "\n"
def _get_all_statuses(self, client):
return itertools.chain(client.list_all_upload_statuses(),
try:
h = IClient(ctx).getServiceNamed("helper")
except KeyError:
- return simplejson.dumps({})
+ return simplejson.dumps({}) + "\n"
stats = h.get_stats()
- return simplejson.dumps(stats, indent=1)
+ return simplejson.dumps(stats, indent=1) + "\n"
def render_active_uploads(self, ctx, data):
return data["chk_upload_helper.active_uploads"]
t = get_arg(inevow.IRequest(ctx), "t")
if t == "json":
inevow.IRequest(ctx).setHeader("content-type", "text/plain")
- return simplejson.dumps(stats, indent=1)
+ return simplejson.dumps(stats, indent=1) + "\n"
# is there a better way to provide 'data' to all rendering methods?
self.original = stats
return rend.Page.renderHTTP(self, ctx)