WSRoot.addprotocol now takes keywords parameters and transmit them to getprotocol for instanciating the protocol

This commit is contained in:
Christophe de Vienne 2011-10-13 13:53:02 +02:00
parent 288ace4bd6
commit 3d150d8ae5
1 changed files with 2 additions and 2 deletions

View File

@ -225,7 +225,7 @@ class WSRoot(object):
self._api = None
def addprotocol(self, protocol):
def addprotocol(self, protocol, **options):
"""
Enable a new protocol on the controller.
@ -233,7 +233,7 @@ class WSRoot(object):
of a protocol.
"""
if isinstance(protocol, str):
protocol = getprotocol(protocol)
protocol = getprotocol(protocol, options)
self.protocols[protocol.name] = protocol
protocol.root = weakref.proxy(self)