-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Everyone,


When I try to use the class listed below, I get the statement that self
is not defined.
                
test=TriggerMessage(data)
var = test.decode(self.qname)

I would have thought that self would have carried forward when I grabbed
an instance of TriggerMessage.

Any ideas on this?



The class in question is:


class TriggerMessage(object):
        
        def __init__(self,data):
                """
                Unpacks the passed binary data based on the MQTCM2 format 
dictated in
                the MQ Application Programming Reference
                """

                self.data=data
                self.structid=None
                self.version=None
                self.qname=None
                self.procname=None
                self.trigdata=None
                self.appltype=None
                self.applid=None
                self.envdata=None
                self.userdata=None
                self.qmgr=None


        def decode(self):
                import struct
                format='4s 4s 48s 48s 64s 4s 256s 128s 128s 48s'
                size=struct.calcsize(format)
                self.data=data  
                self.structid, self.version, self.qname, self.processname,      
 \
                                self.triggerdata, self.appltype, self.applid,   
 \
                                self.envdata, self.userdata, self.qmgr          
 \
                                = struct.unpack(format,self.data)



- --
Thank you,
Andrew Robert
Systems Architect
Information Technologies
MFS Investment Management
Phone:   617-954-5882

E-mail:  [EMAIL PROTECTED]
Linux User Number: #201204
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)

iD8DBQFEcgK6Dvn/4H0LjDwRArwJAKCVdcpLC7IcUzDaMN+L/hVFv8CToQCaA6hP
0KteYe8olY5/72+uktGRCco=
=ToBq
-----END PGP SIGNATURE-----
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to