-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathTopology.py
More file actions
25 lines (19 loc) · 842 Bytes
/
Topology.py
File metadata and controls
25 lines (19 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Copyright (c) 2016-2018 Josh Blum
# SPDX-License-Identifier: BSL-1.0
from . PothosModule import *
class Topology(object):
def __init__(self, *args):
env = ProxyEnvironment("managed")
self._topology = env.findProxy('Pothos/Topology').make(*args)
def connect(self, src, srcPort, dst, dstPort):
return self._topology.connect(src, str(srcPort), dst, str(dstPort))
def disconnect(self, src, srcPort, dst, dstPort):
return self._topology.disconnect(src, str(srcPort), dst, str(dstPort))
def __getattr__(self, name):
return lambda *args: self._topology.call(name, *args)
def getInternalBlock(self):
"""
Get access to the underlying Pothos::Block handle.
Topology uses this call to speak directly to the block.
"""
return self.self._topology