vote pylint fixes
This commit is contained in:
parent
9aa7dd9d78
commit
e5b92e29a2
|
@ -1,23 +1,31 @@
|
||||||
|
"""
|
||||||
|
src/messagetypes/vote.py
|
||||||
|
========================
|
||||||
|
"""
|
||||||
from debug import logger
|
from debug import logger
|
||||||
from messagetypes import MsgBase
|
from messagetypes import MsgBase
|
||||||
|
|
||||||
|
|
||||||
class Vote(MsgBase):
|
class Vote(MsgBase):
|
||||||
def __init__(self):
|
"""Module used to vote"""
|
||||||
return
|
|
||||||
|
|
||||||
def decode(self, data):
|
def decode(self, data):
|
||||||
|
"""decode a vote"""
|
||||||
|
# pylint: disable=attribute-defined-outside-init
|
||||||
self.msgid = data["msgid"]
|
self.msgid = data["msgid"]
|
||||||
self.vote = data["vote"]
|
self.vote = data["vote"]
|
||||||
|
|
||||||
def encode(self, data):
|
def encode(self, data):
|
||||||
super(Vote, self).encode()
|
"""Encode a vote"""
|
||||||
|
super(Vote, self).__init__()
|
||||||
try:
|
try:
|
||||||
self.data["msgid"] = data["msgid"]
|
self.data["msgid"] = data["msgid"]
|
||||||
self.data["vote"] = data["vote"]
|
self.data["vote"] = data["vote"]
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
logger.error("Missing key %s", e.name)
|
logger.error("Missing key %s", e)
|
||||||
return self.data
|
return self.data
|
||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
|
"""Encode a vote"""
|
||||||
logger.debug("msgid: %s", self.msgid)
|
logger.debug("msgid: %s", self.msgid)
|
||||||
logger.debug("vote: %s", self.vote)
|
logger.debug("vote: %s", self.vote)
|
||||||
|
|
Reference in New Issue
Block a user