godot/node.py
def arrange_all(self):
        """ Arrange the components of the node using Graphviz.
        """
        # FIXME: Circular reference avoidance.
        import godot.dot_data_parser
        import godot.graph

        graph = godot.graph.Graph(ID="g")
        graph.add_node(self)

        print "GRAPH DOT:\n", str(graph)

        xdot_data = graph.create( format = "xdot" )

        print "XDOT DATA:\n", xdot_data
        parser = godot.dot_data_parser.GodotDataParser()

#        parser.parse_dot_data(xdot_data)

        flat_data = xdot_data.replace('\\\n','')
        tokens = parser.dotparser.parseString(flat_data)[0]

        for element in tokens[3]:
            print "TOK:", element
            cmd = element[0]
            if cmd == 'add_node':
                cmd, nodename, opts = element
                assert nodename == self.ID
                print "OPTIONS:", opts
                self.set( **opts )
def arrange_all(self):
        """ Arrange the components of the node using Graphviz.
        """
        # FIXME: Circular reference avoidance.
        import godot.dot_data_parser
        import godot.graph

        graph = godot.graph.Graph(ID="g")
        graph.add_node(self)

        print "GRAPH DOT:\n", str(graph)

        xdot_data = graph.create( format = "xdot" )

        print "XDOT DATA:\n", xdot_data
        parser = godot.dot_data_parser.GodotDataParser()

#        parser.parse_dot_data(xdot_data)

        flat_data = xdot_data.replace('\\\n','')
        tokens = parser.dotparser.parseString(flat_data)[0]

        for element in tokens[3]:
            print "TOK:", element
            cmd = element[0]
            if cmd == 'add_node':
                cmd, nodename, opts = element
                assert nodename == self.ID
                print "OPTIONS:", opts
                self.set( **opts )
Arrange the components of the node using Graphviz.