def index(self): tmpl = lookup.get_template("index.html") total,used,free = sysinfo.diskUsage("/") top = sysinfo.top(20) title = sysinfo.hostInfo() print "title", title return tmpl.render(free=free,used=used,top=top,title=title)
def disk(self): total,used,free = sysinfo.diskUsage("/") result = {"label":"Used " + str(used/1024/1024) + " MiB", "data":used},{"label":"Free " + str(free/1024/1024) +" MiB", "data":free} return result