2016-11-12 17:20:45 +01:00
|
|
|
from debug import logger
|
|
|
|
from messagetypes import MsgBase
|
|
|
|
|
|
|
|
class Vote(MsgBase):
|
|
|
|
def __init__(self):
|
|
|
|
return
|
|
|
|
|
|
|
|
def decode(self, data):
|
2016-11-03 22:41:36 +01:00
|
|
|
self.msgid = data["msgid"]
|
|
|
|
self.vote = data["vote"]
|
|
|
|
|
2016-11-12 17:20:45 +01:00
|
|
|
def encode(self, data):
|
|
|
|
super(Vote, self).encode()
|
|
|
|
try:
|
|
|
|
self.data["msgid"] = data["msgid"]
|
|
|
|
self.data["vote"] = data["vote"]
|
|
|
|
except KeyError as e:
|
2017-02-08 14:19:02 +01:00
|
|
|
logger.error("Missing key %s", e.name)
|
2016-11-12 17:20:45 +01:00
|
|
|
return self.data
|
|
|
|
|
2016-11-03 22:41:36 +01:00
|
|
|
def process(self):
|
2016-11-12 17:20:45 +01:00
|
|
|
logger.debug("msgid: %s", self.msgid)
|
|
|
|
logger.debug("vote: %s", self.vote)
|