예제 #1
0
파일: graph.py 프로젝트: carriercomm/fundy
        def dot(self, already_seen=None):
            """
            NOT_RPYTHON: autogenerated dot method for class %s
            """ % cls.__name__
            if already_seen is None:
                already_seen = set()

            if self not in already_seen:
                already_seen.add(self)

                local_self_spec = self_spec.copy()
                for k in local_self_spec:
                    if callable(local_self_spec[k]):
                        local_self_spec[k] = local_self_spec[k](self)

                yield dot_node(self.nodeid(), **local_self_spec)

                for attr_name, link_spec in attrs.items():
                    local_link_spec = link_spec.copy()
                    for k in local_link_spec:
                        if callable(local_link_spec[k]):
                            local_link_spec[k] = local_link_spec[k](self)

                    attr_val = getattr(self, attr_name)
                    if attr_val is not None:
                        yield dot_link(self.nodeid(), attr_val.nodeid(),
                                       **local_link_spec)
                        for thing in attr_val.dot(already_seen):
                            yield thing

                for dot in self.dot_types(already_seen):
                    yield dot
예제 #2
0
파일: graph.py 프로젝트: carriercomm/fundy
    def dot(self, already_seen=None):
        """
        NOT_RPYTHON: Yield a description of the graph under this node.
        """
        if already_seen is None:
            already_seen = set()

        if self not in already_seen:
            already_seen.add(self)
            yield dot_node(self.nodeid(), shape='tripleoctagon',
                           label='UNRENDERABLE', color='red')
            for dot in self.dot_types(already_seen):
                yield dot
예제 #3
0
파일: graph.py 프로젝트: carriercomm/fundy
    def dot(self, already_seen=None):
        """
        NOT_RPYTHON:
        """
        if already_seen is None:
            already_seen = set()

        if self not in already_seen:
            yield dot_node(self.nodeid(), shape='octagon', label='typeswitch',
                           color='cyan')
            for case in self.cases:
                yield dot_link(self.nodeid(), case.nodeid(), color='cyan')
                for thing in case.dot(already_seen):
                    yield thing
예제 #4
0
파일: graph.py 프로젝트: carriercomm/fundy
    def dot(self, already_seen=None):
        """
        NOT_RPYTHON:
        """
        if already_seen is None:
            already_seen = set()

        # NOTE: here we depend on all descendent classes of BuiltinNode
        # having a func member (which we could not do in RPython, unless they
        # all had the same type). But this is Python, so we can just override
        # this method anywhere the assumption doesn't hold.
        if self not in already_seen:
            already_seen.add(self)
            yield dot_node(self.nodeid(), shape='octagon', color='green',
                           label=self.func.func_name)
            for dot in self.dot_types(already_seen):
                yield dot