Skip to content

Commit 0a5379f

Browse files
committed
merge commit conflicts
1 parent 19d6588 commit 0a5379f

4 files changed

Lines changed: 15 additions & 20 deletions

File tree

src/messagetypes/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
src/messagetypes/__init__.py
33
============================
44
"""
5-
# pylint: disable=import-error
65
from importlib import import_module
76
from os import path, listdir
87
from string import lower
@@ -22,7 +21,7 @@ def __init__(self):
2221

2322

2423
def constructObject(data):
25-
"""Construct an object"""
24+
"""Constructing an object"""
2625
whitelist = ["message"]
2726
if data[""] not in whitelist:
2827
return None

src/messagetypes/message.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,22 @@
99

1010
class Message(MsgBase):
1111
"""Base method, helps to decode, encode and process the message"""
12-
def __init__(self): # pylint: disable=super-init-not-called
13-
return
1412

1513
def decode(self, data):
16-
"""Method used for decoding the message"""
14+
"""Decode a message"""
1715
# UTF-8 and variable type validator
18-
# pylint: disable=unidiomatic-typecheck
19-
if type(data["subject"]) is str:
16+
if isinstance(data["subject"], str):
2017
self.subject = unicode(data["subject"], 'utf-8', 'replace')
2118
else:
2219
self.subject = unicode(str(data["subject"]), 'utf-8', 'replace')
23-
if type(data["body"]) is str:
20+
if isinstance(data["body"], str):
2421
self.body = unicode(data["body"], 'utf-8', 'replace')
2522
else:
2623
self.body = unicode(str(data["body"]), 'utf-8', 'replace')
2724

2825
def encode(self, data):
29-
"""Method used for encoding the message"""
30-
# pylint: disable=no-member
31-
super(Message, self).encode()
26+
"""Encode a message"""
27+
super(Message, self).__init__()
3228
try:
3329
self.data["subject"] = data["subject"]
3430
self.data["body"] = data["body"]
@@ -37,6 +33,6 @@ def encode(self, data):
3733
return self.data
3834

3935
def process(self):
40-
"""Method used for process the message"""
36+
"""Process a message"""
4137
logger.debug("Subject: %i bytes", len(self.subject))
4238
logger.debug("Body: %i bytes", len(self.body))

src/messagetypes/vote.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,27 @@
77
# pylint: disable=attribute-defined-outside-init
88

99

10+
1011
class Vote(MsgBase):
1112
"""Base method, helps to decode, encode and process the message"""
12-
def __init__(self): # pylint: disable=super-init-not-called
13-
return
1413

1514
def decode(self, data):
16-
"""Method used for decoding the message"""
15+
"""decode a vote"""
16+
# pylint: disable=attribute-defined-outside-init
1717
self.msgid = data["msgid"]
1818
self.vote = data["vote"]
1919

2020
def encode(self, data):
21-
"""Method used for encoding the message"""
22-
# pylint: disable=no-member
23-
super(Vote, self).encode()
21+
"""Encode a vote"""
22+
super(Vote, self).__init__()
2423
try:
2524
self.data["msgid"] = data["msgid"]
2625
self.data["vote"] = data["vote"]
2726
except KeyError as e:
28-
logger.error("Missing key %s", e.name)
27+
logger.error("Missing key %s", e)
2928
return self.data
3029

3130
def process(self):
32-
"""Method used for process the message"""
31+
"""Encode a vote"""
3332
logger.debug("msgid: %s", self.msgid)
3433
logger.debug("vote: %s", self.vote)

src/pyelliptic/openssl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ def malloc(self, data, size):
657657
def loadOpenSSL():
658658
"""Method find and load the OpenSSL library"""
659659
# pylint: disable=global-statement, protected-access, too-many-branches
660+
660661
global OpenSSL
661662
from os import path, environ
662663
from ctypes.util import find_library

0 commit comments

Comments
 (0)