From 6a44daa26e1cbb279b1d3eac237c7dee77515114 Mon Sep 17 00:00:00 2001 From: Kun Huang Date: Fri, 30 Oct 2015 13:20:50 +0800 Subject: [PATCH] support report html * add a lin-chart mako * support more on result command * --html could report stdout instead pretty print Change-Id: I8819cc8ac375b9ae2ad4d3055704e617b82799f4 --- requirements.txt | 1 + scalpels/cli/actions/report.py | 16 ++++++++++++- scalpels/cli/actions/result.py | 16 ++++++++++++- scalpels/cli/shell.py | 2 ++ scalpels/templates/__init__.py | 0 scalpels/templates/line-chart.mako | 38 ++++++++++++++++++++++++++++++ 6 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 scalpels/templates/__init__.py create mode 100644 scalpels/templates/line-chart.mako diff --git a/requirements.txt b/requirements.txt index 4bb879a..4ce4c07 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 psutil>=1.1.1,<2.0.0 tooz>=1.19.0 # Apache-2.0 PrettyTable>=0.7,<0.8 +Mako>=0.4.0 diff --git a/scalpels/cli/actions/report.py b/scalpels/cli/actions/report.py index 641005e..9b3be64 100644 --- a/scalpels/cli/actions/report.py +++ b/scalpels/cli/actions/report.py @@ -4,10 +4,15 @@ from scalpels.db import api as db_api from prettytable import PrettyTable +from mako.template import Template +from mako.lookup import TemplateLookup +from scalpels import templates +import os def pprint_result(result): - t = PrettyTable(["timestamp", "%s(%s)" % (result.name, result.unit)]) + print " + + + + + + +
+ +