Use new-style classes and Session should call super.__init__

This commit is contained in:
moyamo 2015-08-30 21:03:11 +02:00
parent 254465301b
commit 47d52ae22c
2 changed files with 3 additions and 2 deletions

View File

@ -83,6 +83,7 @@ from yowsupwrapper import YowsupApp
class Session(YowsupApp):
def __init__(self, backend, user, legacyName, extra, db):
super(Session, self).__init__()
self.logger = logging.getLogger(self.__class__.__name__)
self.logger.info("Created: %s", legacyName)

View File

@ -32,7 +32,7 @@ from yowsup.layers.protocol_messages.protocolentities import TextMessageProtoco
from yowsup.layers.protocol_chatstate.protocolentities import *
from yowsup.layers.protocol_acks.protocolentities import *
class YowsupApp:
class YowsupApp(object):
def __init__(self):
env.CURRENT_ENV = env.S40YowsupEnv()
@ -234,7 +234,7 @@ class YowsupAppLayer(YowInterfaceLayer):
self.caller.onReceipt(_id, _from, timestamp, type, participant, offline, items)
@ProtocolEntityCallback('ack')
def onAck(self, entity)
def onAck(self, entity):
# entity is IncomingAckProtocolEntity
self.caller.onAck(
entity._id,