flow/network: require ActorNode be passed to add_connection

This commit is contained in:
Sebastien Bourdeauducq 2012-06-16 22:40:26 +02:00
parent b0b0380ea7
commit 9af87367eb
1 changed files with 2 additions and 4 deletions

View File

@ -53,10 +53,8 @@ class DataFlowGraph(MultiDiGraph):
def add_connection(self, source_node, sink_node, def add_connection(self, source_node, sink_node,
source_ep=None, sink_ep=None, # default: assume nodes have 1 source/sink and use that one source_ep=None, sink_ep=None, # default: assume nodes have 1 source/sink and use that one
source_subr=None, sink_subr=None): # default: use whole record source_subr=None, sink_subr=None): # default: use whole record
if not isinstance(source_node, ActorNode): assert(isinstance(source_node, ActorNode))
source_node = ActorNode(source_node) assert(isinstance(sink_node, ActorNode))
if not isinstance(sink_node, ActorNode):
sink_node = ActorNode(sink_node)
self.add_edge(source_node, sink_node, self.add_edge(source_node, sink_node,
source=source_ep, sink=sink_ep, source=source_ep, sink=sink_ep,
source_subr=source_subr, sink_subr=sink_subr) source_subr=source_subr, sink_subr=sink_subr)