当前位置: 首页>>代码示例>>Python>>正文


Python ExceptionCollector.start方法代码示例

本文整理汇总了Python中toscaparser.common.exception.ExceptionCollector.start方法的典型用法代码示例。如果您正苦于以下问题:Python ExceptionCollector.start方法的具体用法?Python ExceptionCollector.start怎么用?Python ExceptionCollector.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在toscaparser.common.exception.ExceptionCollector的用法示例。


在下文中一共展示了ExceptionCollector.start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from toscaparser.common.exception import ExceptionCollector [as 别名]
# 或者: from toscaparser.common.exception.ExceptionCollector import start [as 别名]
    def __init__(self, path=None, parsed_params=None, a_file=True,
                 yaml_dict_tpl=None):

        ExceptionCollector.start()
        self.a_file = a_file
        self.input_path = None
        self.path = None
        self.tpl = None
        self.nested_tosca_tpls_with_topology = {}
        self.nested_tosca_templates_with_topology = []
        if path:
            self.input_path = path
            self.path = self._get_path(path)
            if self.path:
                self.tpl = YAML_LOADER(self.path, self.a_file)
            if yaml_dict_tpl:
                msg = (_('Both path and yaml_dict_tpl arguments were '
                         'provided. Using path and ignoring yaml_dict_tpl.'))
                log.info(msg)
                print(msg)
        else:
            if yaml_dict_tpl:
                self.tpl = yaml_dict_tpl
            else:
                ExceptionCollector.appendException(
                    ValueError(_('No path or yaml_dict_tpl was provided. '
                                 'There is nothing to parse.')))

        if self.tpl:
            self.parsed_params = parsed_params
            self._validate_field()
            self.version = self._tpl_version()
            self.relationship_types = self._tpl_relationship_types()
            self.description = self._tpl_description()
            self.topology_template = self._topology_template()
            self.repositories = self._tpl_repositories()
            if self.topology_template.tpl:
                self.inputs = self._inputs()
                self.relationship_templates = self._relationship_templates()
                self.nodetemplates = self._nodetemplates()
                self.outputs = self._outputs()
                self._handle_nested_tosca_templates_with_topology()
                self.graph = ToscaGraph(self.nodetemplates)

        ExceptionCollector.stop()
        self.verify_template()
开发者ID:openstack,项目名称:tosca-parser,代码行数:48,代码来源:tosca_template.py

示例2: __init__

# 需要导入模块: from toscaparser.common.exception import ExceptionCollector [as 别名]
# 或者: from toscaparser.common.exception.ExceptionCollector import start [as 别名]
 def __init__(self, path, parsed_params=None, a_file=True):
     ExceptionCollector.start()
     self.a_file = a_file
     self.input_path = path
     self.path = self._get_path(path)
     if self.path:
         self.tpl = YAML_LOADER(self.path, self.a_file)
         self.parsed_params = parsed_params
         self._validate_field()
         self.version = self._tpl_version()
         self.relationship_types = self._tpl_relationship_types()
         self.description = self._tpl_description()
         self.topology_template = self._topology_template()
         if self.topology_template.tpl:
             self.inputs = self._inputs()
             self.relationship_templates = self._relationship_templates()
             self.nodetemplates = self._nodetemplates()
             self.outputs = self._outputs()
             self.graph = ToscaGraph(self.nodetemplates)
     ExceptionCollector.stop()
     self.verify_template()
开发者ID:semk,项目名称:tosca-parser,代码行数:23,代码来源:tosca_template.py


注:本文中的toscaparser.common.exception.ExceptionCollector.start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。