Mercurial > code > home > repos > light9
view flax/Ports.py @ 289:3b73f0a58a54
Move general use gyro function get_sub to Submaster, make global Submasters object
- gyro's error subs now look like normal subs since they might reload and turn
into good subs.
- Also, add Submaster.fullsub which helps you make subs from channel names.
author | David McClosky <dmcc@bigasterisk.com> |
---|---|
date | Sat, 18 Jun 2005 01:45:05 +0000 |
parents | 45b12307c695 |
children |
line wrap: on
line source
# super rough code class AbstractPort: def __init__(self): pass def put_data(self, value): pass def get_data(self): pass class Port(AbstractPort): "Connects from a node to exactly one node." def __init__(self, value=None): AbstractPort.__init__(self) self.value = value def put_data(self, value): self.value = value def get_data(self): return self.value class MultiPort(AbstractPort): "Connects from a node to any number of nodes." def __init__(self, values=None): AbstractPort.__init__(self) self.values = values def put_data(self, values): self.values = values def get_data(self): return self.values