Greg
unread,May 26, 2009, 4:00:26 PM5/26/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pydot
I've used yapgvb recently, but am considering switching to pydot due
to lake of functionality in yapgvb.
I really like in yapgvb how I can create nodes and edges using
something similar to this:
node1 = g.add_node(Node('node1'))
node2 = g.add_node(Node('node2'))
node1 >> node2
To acheive this functionality in pydot, it's simple:
1) Add the following method to the Node class:
def __rshift__(head, tail):
parentGraph = head.get_parent_graph()
parentGraph.add_edge(Edge(head, tail))
2) cause add_node to return the inputed node instead of returning
None. (I'd also recommend that the other add_ calls return the
inputted objects)
My apologies these changes aren't in patch form.
Greg