(self, handler, command_char)
Turn the event ON, OFF and STOP.
Turn the event ON, OFF and STOP.
Turn the event ON OFF and STOP .
def command(self, handler, command_char):
        """Turn the event ON, OFF and STOP."""
        if command_char == tk.ON:
            self.enabled.add(handler)
            handler.stopped = False
        elif command_char == tk.OFF:
            # we seem to need to keep ComHandler around to make serial events work correctly
            # i.e. apparently they can be triggered when switched off - I don't understand why
            if not isinstance(handler, ComHandler):
                self.enabled.discard(handler)
        elif command_char == tk.STOP:
            handler.stopped = True
def command ( self , handler , command_char ) : if command_char == tk . ON : self . enabled . add ( handler ) handler . stopped = False elif command_char == tk . OFF : # we seem to need to keep ComHandler around to make serial events work correctly # i.e. apparently they can be triggered when switched off - I don't understand why if not isinstance ( handler , ComHandler ) : self . enabled . discard ( handler ) elif command_char == tk . STOP : handler . stopped = True