1 ##############################################################################
2 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
12 LOG = logging.getLogger(__name__)
13 from vstf.controller.settings.html_settings import HtmlSettings
14 from vstf.controller.settings.template_settings import TemplateSettings
17 class HtmlProvider(object):
18 def __init__(self, info, style):
24 assert "style" in self._style
25 return self._style["style"]
28 def get_context(self):
29 assert "context" in self._info
30 return self._info["context"]
34 from vstf.common.log import setup_logging
35 setup_logging(level=logging.DEBUG, log_file="/var/log/html-provder.log", clevel=logging.INFO)
37 html_settings = HtmlSettings()
38 LOG.info(html_settings.settings)
39 info = TemplateSettings()
40 provider = HtmlProvider(info.settings, html_settings.settings)
41 LOG.info(provider.get_style)
42 LOG.info(provider.get_context)
44 if __name__ == '__main__':