messagetypes init flake and pylint fixes
This commit is contained in:
parent
fba2d6d837
commit
40e15579fd
|
@ -1,3 +1,7 @@
|
||||||
|
"""
|
||||||
|
src/messagetypes/__init__.py
|
||||||
|
============================
|
||||||
|
"""
|
||||||
from importlib import import_module
|
from importlib import import_module
|
||||||
from os import path, listdir
|
from os import path, listdir
|
||||||
from string import lower
|
from string import lower
|
||||||
|
@ -6,12 +10,15 @@ from debug import logger
|
||||||
import messagetypes
|
import messagetypes
|
||||||
import paths
|
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__)}
|
self.data = {"": lower(type(self).__name__)}
|
||||||
|
|
||||||
|
|
||||||
def constructObject(data):
|
def constructObject(data):
|
||||||
|
"""Constructing an object"""
|
||||||
whitelist = ["message"]
|
whitelist = ["message"]
|
||||||
if data[""] not in whitelist:
|
if data[""] not in whitelist:
|
||||||
return None
|
return None
|
||||||
|
@ -32,6 +39,7 @@ def constructObject(data):
|
||||||
else:
|
else:
|
||||||
return returnObj
|
return returnObj
|
||||||
|
|
||||||
|
|
||||||
if paths.frozen is not None:
|
if paths.frozen is not None:
|
||||||
import messagetypes.message
|
import messagetypes.message
|
||||||
import messagetypes.vote
|
import messagetypes.vote
|
||||||
|
|
Reference in New Issue
Block a user