Beispiel #1
0
    def add_sxs(self, client, node_trees, context):
        """Finds sxs associated with this section, adds them to the
        context"""
        version = context['version']
        label_id = context['label_id']
        if 'Interp' in label_id:
            reg_part = label_id.split('-')[0]
            sxs_layer_data = client.layer('analyses', reg_part + '-Interp',
                                          version)
        else:
            sxs_layer_data = client.layer('analyses', label_id, version)

        results = []
        result_key = None
        if sxs_layer_data:
            sxs_layer = SectionBySectionLayer(sxs_layer_data)
            for tree in node_trees:
                result = sxs_layer.apply_layer('-'.join(tree['label']))
                if result:
                    result_key = result[0]
                    results.extend(result[1])

        if result_key:
            context[result_key] = results
    def add_sxs(self, client, node_trees, context):
        """Finds sxs associated with this section, adds them to the
        context"""
        version = context['version']
        label_id = context['label_id']
        if 'Interp' in label_id:
            reg_part = label_id.split('-')[0]
            sxs_layer_data = client.layer('analyses', reg_part + '-Interp',
                                          version)
        else:
            sxs_layer_data = client.layer('analyses', label_id, version)

        results = []
        result_key = None
        if sxs_layer_data:
            sxs_layer = SectionBySectionLayer(sxs_layer_data)
            for tree in node_trees:
                result = sxs_layer.apply_layer('-'.join(tree['label']))
                if result:
                    result_key = result[0]
                    results.extend(result[1])

        if result_key:
            context[result_key] = results