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:
|
|
|
|
logger.error("Missing key ", e.name)
|
|
|
|
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)
|