def _get_about(): current_time = int(time.time()) about = { "uptime" : automium.delta_string(current_time - start_time), "system" : automium.resolve_os() } return about
def _build(cls, model, map): base.Base._build(model, map) result = model.get("result", False) delta = model.get("delta", 0) start_time = model.get("start_time", 0.0) end_time = model.get("end_time", 0.0) stat_time_d = datetime.datetime.fromtimestamp(start_time) end_time_d = datetime.datetime.fromtimestamp(end_time) model["result_l"] = result and "passed" or "failed" model["delta_l"] = automium.delta_string(delta) model["start_time_l"] = stat_time_d.strftime("%b %d, %Y %H:%M:%S") model["end_time_l"] = end_time_d.strftime("%b %d, %Y %H:%M:%S")
def _get_about(): current_time = int(time.time()) return dict( uptime = automium.delta_string(current_time - start_time), system = automium.resolve_os() )