"vscode:/vscode.git/clone" did not exist on "a6e1d4cf74826c0c465f0e01861f8aae3c26e8e7"
Commit 01f4aa6e authored by Hejing Li's avatar Hejing Li
Browse files

system/base.py: add find_peer function to interface class

parent f43660c8
......@@ -74,6 +74,15 @@ class Interface(util_base.IdObj):
assert self.channel is None
self.channel = c
def find_peer(self) -> Interface:
assert self.channel is not None
if self.channel.a == self:
peer_if = self.channel.b
else:
peer_if = self.channel.a
return peer_if
class Channel(util_base.IdObj):
def __init__(self, a: Interface, b: Interface) -> None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment