Some abstract concepts
This commit is contained in:
parent
2dafc1ae4c
commit
5909db187f
@ -14,7 +14,3 @@ from Output import Output
|
|||||||
class Filter(Input, Output):
|
class Filter(Input, Output):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__('Filter')
|
super().__init__('Filter')
|
||||||
|
|
||||||
def _run(self):
|
|
||||||
print('ima not virtual!')
|
|
||||||
|
|
||||||
|
|||||||
@ -26,5 +26,12 @@ class Output(Node):
|
|||||||
if not isinstance(inode, (Input)):
|
if not isinstance(inode, (Input)):
|
||||||
raise NotImplementedError('{} is not an Input'.format(inode))
|
raise NotImplementedError('{} is not an Input'.format(inode))
|
||||||
self.__dict__['input'] = inode
|
self.__dict__['input'] = inode
|
||||||
|
inode.register(self)
|
||||||
|
|
||||||
|
def process(self, data):
|
||||||
|
self._process(data)
|
||||||
|
|
||||||
|
def _process(self, data):
|
||||||
|
raise NotImplementedError('{} should override _process()'.format(self))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,8 @@ def main():
|
|||||||
print(n.input)
|
print(n.input)
|
||||||
n.input = f
|
n.input = f
|
||||||
print(n.input)
|
print(n.input)
|
||||||
|
print(f.outputs)
|
||||||
|
f.process(None)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user