示例#1
0
 def check_tree(self, context):
     """Throw an exception if the requested section doesn't exist"""
     label_id, version = context['label_id'], context['version']
     relevant_tree = generator.get_tree_paragraph(label_id, version)
     if relevant_tree is None:
         raise error_handling.MissingSectionException(label_id, version,
                                                      context)
示例#2
0
    def check_tree(self, context):
        """We can't defer to Chrome's check because Subterps are constructed
        -site side"""
        version, label_id = context['version'], context['label_id']
        label = label_id.split('-')
        reg_part = label[0]

        interp = generator.get_tree_paragraph(reg_part + '-Interp', version)
        if not interp:
            raise error_handling.MissingSectionException(label_id, version,
                                                         context)

        subterp_sects = filter_by_subterp(interp['children'], label, version)
        if not subterp_sects:
            raise error_handling.MissingSectionException(label_id, version,
                                                         context)