messagetypes init flake and pylint fixes

v0.6
lakshyacis 4 years ago
parent fba2d6d837
commit 40e15579fd
No known key found for this signature in database
GPG Key ID: D2C539C8EC63E9EB

@ -1,3 +1,7 @@
"""
src/messagetypes/__init__.py
============================
"""
from importlib import import_module
from os import path, listdir
from string import lower
@ -6,12 +10,15 @@ from debug import logger
import messagetypes
import paths
class MsgBase(object):
def encode(self):
class MsgBase(object): # pylint: disable=too-few-public-methods
"""Base class for message types"""
def __init__(self):
self.data = {"": lower(type(self).__name__)}
def constructObject(data):
"""Constructing an object"""
whitelist = ["message"]
if data[""] not in whitelist:
return None
@ -32,6 +39,7 @@ def constructObject(data):
else:
return returnObj
if paths.frozen is not None:
import messagetypes.message
import messagetypes.vote

Loading…
Cancel
Save