Ejemplo n.º 1
0
        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
Ejemplo n.º 2
0
    def dot_types(self, already_seen=None):
        """
        NOT_RPYTHON:
        """
        if already_seen is None:
            already_seen = set()

        for typeptr in self.types:
            yield dot_link(self.nodeid(), typeptr.nodeid(),
                           color='cyan', style='dashed')
            for dot in typeptr.dot(already_seen):
                yield dot
Ejemplo n.º 3
0
    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