From 6d9521fff519412e66d585d8f980824414a218eb Mon Sep 17 00:00:00 2001 From: "Yiting.Li" Date: Tue, 19 Jan 2016 14:39:31 +0800 Subject: JIRA: BOTTLENECKS-29 add the performance test framework add the copyright on the code. Change-Id: I6ec9eefe65bf07c2dd6c636d1b90b64da303952e Signed-off-by: Yiting.Li (cherry picked from commit 5b4f794932cb9b28ec679e6dd88e6febb2a5db7b) --- .../controller/reporters/report/html/html_base.py | 40 ++++++++++++---------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'vstf/vstf/controller/reporters/report/html/html_base.py') diff --git a/vstf/vstf/controller/reporters/report/html/html_base.py b/vstf/vstf/controller/reporters/report/html/html_base.py index 270ef394..36be5981 100755 --- a/vstf/vstf/controller/reporters/report/html/html_base.py +++ b/vstf/vstf/controller/reporters/report/html/html_base.py @@ -1,41 +1,43 @@ -#!/usr/bin/python -# -*- coding: utf8 -*- -# author: wly -# date: 2015-09.25 -# see license for license details +############################################################################## +# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + __version__ = ''' ''' import os -from vstf.common.pyhtml import * +import vstf.common.pyhtml as pyhtm class HtmlBase(object): - def __init__(self, provider, ofile='text.html'): - self._page = PyHtml('HtmlBase Text') - self._ofile = ofile + def __init__(self, provider): + self._page = pyhtm.PyHtml('Html Text') self._provider = provider - self._chapter = 1 - def save(self): - if self._ofile: - os.system('rm -rf %s' % self._ofile) - self._page.output(self._ofile) + def save(self, ofile): + if ofile: + os.system('rm -rf %s' % ofile) + self._page.output(ofile) def as_string(self): return self._page.as_string() def add_table(self, data): - self._page.add_table(data) + if data and zip(*data): + self._page.add_table(data) def add_style(self): - style = self._provider.get_style() + style = self._provider.get_style self._page.add_style(style) - def create(self, is_save=True): + def create(self, ofile='text.html'): self.add_style() self.create_story() - if is_save: - self.save() + self.save(ofile) return self.as_string() def create_story(self): -- cgit 1.2.3-korg