Example #1
0
        def walk(fmap, ipset, dpset):
            for k, v in fmap.iteritems():
                # if not an 'arg_#' or intermediate 'non-parameter' - add to dpset
                if 'arg' not in k:
                    if k.startswith('<') and k.endswith('>'):
                        ipset.add(k[1:-1])
                    elif k.startswith('[') and k.endswith(
                            ']'):  # Intermediate 'non parameter' - continue
                        pass
                    else:
                        # dependent parameter
                        dpset.add(AbstractFunction._parse_map_name(k)[1])

                if v is None:
                    continue
                elif isinstance(v, dict):
                    walk(v, ipset, dpset)
                elif v.startswith('<') and v.endswith('>'):
                    # independent parameter
                    ipset.add(AbstractFunction._parse_map_name(v[1:-1])[1])
                elif k.startswith('[') and k.endswith(
                        ']'):  # Intermediate 'non parameter' - continue
                    continue
                else:
                    # dependent parameter
                    dpset.add(AbstractFunction._parse_map_name(v)[1])
Example #2
0
        def walk(fmap, ipset, dpset):
            for k, v in fmap.iteritems():
                # if not an 'arg_#' or intermediate 'non-parameter' - add to dpset
                if 'arg' not in k:
                    if k.startswith('<') and k.endswith('>'):
                        ipset.add(k[1:-1])
                    elif k.startswith('[') and k.endswith(']'):  # Intermediate 'non parameter' - continue
                        pass
                    else:
                        # dependent parameter
                        dpset.add(AbstractFunction._parse_map_name(k)[1])

                if v is None:
                    continue
                elif isinstance(v, dict):
                    walk(v, ipset, dpset)
                elif v.startswith('<') and v.endswith('>'):
                    # independent parameter
                    ipset.add(AbstractFunction._parse_map_name(v[1:-1])[1])
                elif k.startswith('[') and k.endswith(']'):  # Intermediate 'non parameter' - continue
                    continue
                else:
                    # dependent parameter
                    dpset.add(AbstractFunction._parse_map_name(v)[1])
Example #3
0
    def _add_graph_node(self, graph, name):
        if name.startswith('<') and name.endswith('>'):
            n = name[1:-1]
            c = 'forestgreen'
        elif name.startswith('[') and name.endswith(']'):
            n = name[1:-1]
            c = 'blue'
        elif name.startswith('!') and name.endswith('!'):
            n = name[1:-1]
            c = 'red'
        else:
            n = name
            c = 'black'

        if ':|:' in n:
            a, n = AbstractFunction._parse_map_name(n)
        else:
            a = ''

        graph.add_node(n, color=c, fontcolor=c)

        return a, n
Example #4
0
    def _add_graph_node(self, graph, name):
        if name.startswith('<') and name.endswith('>'):
            n = name[1:-1]
            c = 'forestgreen'
        elif name.startswith('[') and name.endswith(']'):
            n = name[1:-1]
            c = 'blue'
        elif name.startswith('!') and name.endswith('!'):
            n = name[1:-1]
            c = 'red'
        else:
            n = name
            c = 'black'

        if ':|:' in n:
            a, n = AbstractFunction._parse_map_name(n)
        else:
            a = ''

        graph.add_node(n, color=c, fontcolor=c)

        return a, n