From 4f66b46c67692d028d52f8fb1f95e07c613dde28 Mon Sep 17 00:00:00 2001 From: Adam Waldenberg Date: Tue, 9 Apr 2013 21:44:44 +0200 Subject: [PATCH] Added HTML output to the metrics module. --- metrics.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/metrics.py b/metrics.py index ddd0bb4..147065e 100644 --- a/metrics.py +++ b/metrics.py @@ -75,6 +75,20 @@ class Metrics(Outputable): for i in sorted(set([(j, i) for (i, j) in metrics_logic.eloc.items()]), reverse = True): print(i[1] + " (" + str(i[0]) + " eloc)") + def output_html(self): + metrics_logic = MetricsLogic() + metrics_xml = "
" + + if not metrics_logic.eloc: + metrics_xml += "

" + __metrics_missing_info_text__ + ".

" + else: + metrics_xml += "

" + __eloc_info_text__ + ".

" + for i in sorted(set([(j, i) for (i, j) in metrics_logic.eloc.items()]), reverse = True): + metrics_xml += "

" + i[1] + " (" + str(i[0]) + " eloc)

" + + metrics_xml += "
" + print(metrics_xml) + def output_xml(self): metrics_logic = MetricsLogic()