From 5348465e606bafa9467a5980c4449a8d77b236be Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Tue, 14 Mar 2017 19:29:45 +0000 Subject: [PATCH] Fix 1d1bb2a2a issue by defining init in DelugeRPCProtocol --- deluge/core/rpcserver.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deluge/core/rpcserver.py b/deluge/core/rpcserver.py index 7713c9543..c7a104c75 100644 --- a/deluge/core/rpcserver.py +++ b/deluge/core/rpcserver.py @@ -108,6 +108,11 @@ class ServerContextFactory(object): class DelugeRPCProtocol(DelugeTransferProtocol): + def __init__(self): + super(DelugeRPCProtocol, self).__init__() + # namedtuple subclass with auth_level, username for the connected session. + self.AuthLevel = namedtuple('SessionAuthlevel', 'auth_level, username') + def message_received(self, request): """ This method is called whenever a message is received from a client. The @@ -159,7 +164,6 @@ class DelugeRPCProtocol(DelugeTransferProtocol): log.info('Deluge Client connection made from: %s:%s', peer.host, peer.port) # Set the initial auth level of this session to AUTH_LEVEL_NONE - self.AuthLevel = namedtuple('SessionAuthlevel', 'auth_level, username') self.factory.authorized_sessions[ self.transport.sessionno] = self.AuthLevel(AUTH_LEVEL_NONE, '')