from view_common import * class SimulatorView(View): def get(self, request, **kwargs): sim = json.loads(file("/tmp/simulator.json","r").read()) text = "" text += "Iteration: %d
" % sim["iteration"] text += "Elapsed since report %d

" % sim["elapsed_since_report"] text += "" text += "" for site in sim["site_load"].values(): text += "" text += "" % \ (site["name"], site["trend"], site["weight"], site["bytes_sent"], site["load_frac"]) text += "" text += "
sitetrendweightbytes_senthot
%s%0.2f%0.2f%d%0.2f
" text += "" return HttpResponse(text)