I am using Twisted and have a couple of callbacks, both of different types (so they don't share a factory). I am trying to get data from one callback object to another:
class CallbackA(object):
def transmit(self, data):
self.sendMessage(self, data)
class CallbackB(object):
def doRead(self): # this is called by Twisted
self.point_to_A.transmit(self.point_to_A, data)
class bigClass(object):
A = aClass
B = bClass
self.B.point_to_A = self.A
Now, I was able to get this to work by using @staticmethod before transmit. Then I added the method (from twisted) self.sendMessage. I got an error: 'global name self is not defined'. Ok. So I passed the object as the first argument like this:
self.point_to_A.transmit(self.point_to_A, data)
Then I get an error like this: 'unbou