def registerProtocol(self, protocol): if protocol not in self.protocols: self.protocols.append(protocol) # protocol.startProtocol() else: raise "Registered Protocol", protocol, "twice" protocol.setTransport(self)
def unRegisterProtocol(self, protocol): if protocol in self.protocols: protocol.setTransport(None) self.protocols.remove(protocol) else: raise "Removed Protocol", protocol, "that isn't registered"