Files @ d5858e9fa689
Branch filter:

Location: light9/flax/Ports.py

David McClosky
keyboardcomposer destroy fix and cleanups
- We were destroying KeyboardComposer a little too much. Fortunately,
we weren't passing the right number of arguments, so this was merely
an error.
- About the TODO comment removed: we don't need to use combine_dict
since Submaster logic will be changed entirely when we/if we move
to a SubServer world and keyboard composer will not be the wiser.
# 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