Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added priority to link_to and similar methods.

  • Loading branch information...
commit 876f853a84ee1f0913f482b6251b074fba62a542 1 parent 016bf2b
@rik0 authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 pynetsym/core.py
View
12 pynetsym/core.py
@@ -360,7 +360,7 @@ def __init__(self, identifier, address_book, graph):
super(Node, self).__init__(identifier, address_book)
self.graph = graph
- def link_to(self, criterion_or_node):
+ def link_to(self, criterion_or_node, priority=Priority.NORMAL):
"""
Sends an 'accept_link' message to the specified node.
@@ -374,9 +374,11 @@ def link_to(self, criterion_or_node):
target_node = criterion_or_node(self.graph)
else:
target_node = criterion_or_node
- self.send(target_node, 'accept_link', originating_node=self.id)
+ self.send(target_node, 'accept_link',
+ priority=priority,
+ originating_node=self.id)
- def unlink_from(self, criterion_or_node):
+ def unlink_from(self, criterion_or_node, priority=Priority.NORMAL):
"""
Sends a 'drop_link' message to the specified node.
@@ -390,7 +392,9 @@ def unlink_from(self, criterion_or_node):
target_node = criterion_or_node(self.graph.handle)
else:
target_node = criterion_or_node
- self.send(target_node, 'drop_link', originating_node=self.id)
+ self.send(target_node, 'drop_link',
+ priority=priority,
+ originating_node=self.id)
def accept_link(self, originating_node):
"""
Please sign in to comment.
Something went wrong with that request. Please try again.