/usr/lib/python2.6/site-packages/boto/sqs
NameSizeModeActions
attributes.py17180644editdlrm
attributes.pyc12120644editdlrm
attributes.pyo12120644editdlrm
batchresults.py35150644editdlrm
batchresults.pyc33040644editdlrm
batchresults.pyo33040644editdlrm
bigmessage.py47290644editdlrm
bigmessage.pyc38980644editdlrm
bigmessage.pyo38980644editdlrm
connection.py215410644editdlrm
connection.pyc200400644editdlrm
connection.pyo200400644editdlrm
jsonmessage.py17550644editdlrm
jsonmessage.pyc12730644editdlrm
jsonmessage.pyo12730644editdlrm
message.py97870644editdlrm
message.pyc121290644editdlrm
message.pyo121290644editdlrm
messageattributes.py24870644editdlrm
messageattributes.pyc23620644editdlrm
messageattributes.pyo23620644editdlrm
queue.py177890644editdlrm
queue.pyc187910644editdlrm
queue.pyo187910644editdlrm
regioninfo.py15240644editdlrm
regioninfo.pyc7860644editdlrm
regioninfo.pyo7860644editdlrm
__init__.py17050644editdlrm
__init__.pyc10160644editdlrm
__init__.pyo10160644editdlrm
Edit: /usr/lib/python2.6/site-packages/boto/sqs/message.pyc (12129B)
Ñò Å-õSc @sºdZddkZddkZddklZddklZddklZddk l Z de fd„ƒYZ d e fd „ƒYZ d e fd „ƒYZd efd„ƒYZdS(sX SQS Message A Message represents the data stored in an SQS queue. The rules for what is allowed within an SQS Message are here: http://docs.amazonwebservices.com/AWSSimpleQueueService/2008-01-01/SQSDeveloperGuide/Query_QuerySendMessage.html So, at it's simplest level a Message just needs to allow a developer to store bytes in it and get the bytes back out. However, to allow messages to have richer semantics, the Message class must support the following interfaces: The constructor for the Message class must accept a keyword parameter "queue" which is an instance of a boto Queue object and represents the queue that the message will be stored in. The default value for this parameter is None. The constructor for the Message class must accept a keyword parameter "body" which represents the content or body of the message. The format of this parameter will depend on the behavior of the particular Message subclass. For example, if the Message subclass provides dictionary-like behavior to the user the body passed to the constructor should be a dict-like object that can be used to populate the initial state of the message. The Message class must provide an encode method that accepts a value of the same type as the body parameter of the constructor and returns a string of characters that are able to be stored in an SQS message body (see rules above). The Message class must provide a decode method that accepts a string of characters that can be stored (and probably were stored!) in an SQS message and return an object of a type that is consistent with the "body" parameter accepted on the class constructor. The Message class must provide a __len__ method that will return the size of the encoded message that would be stored in SQS based on the current state of the Message object. The Message class must provide a get_body method that will return the body of the message in the same format accepted in the constructor of the class. The Message class must provide a set_body method that accepts a message body in the same format accepted by the constructor of the class. This method should alter to the internal state of the Message object to reflect the state represented in the message body parameter. The Message class must provide a get_body_encoded method that returns the current body of the message in the format in which it would be stored in SQS. iÿÿÿÿN(tStringIO(t Attributes(tMessageAttributes(tSQSDecodeErrort RawMessagecBs€eZdZddd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „ZRS(s Base class for SQS messages. RawMessage does not encode the message in any way. Whatever you store in the body of the message is what will be written to SQS and whatever is returned from SQS is stored directly into the body of the message. tcCs\||_|i|ƒd|_d|_d|_t|ƒ|_t|ƒ|_ d|_ dS(N( tqueuetset_bodytNonetidtreceipt_handletmd5Rt attributesRtmessage_attributestmd5_message_attributes(tselfRtbody((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyt__init__Ss     cCst|i|iƒƒS(N(tlentencodet_body(R((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyt__len__]scCs.|djo|iS|djo|iSdS(Nt AttributetMessageAttribute(R R R(Rtnametattrst connection((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyt startElement`s   cCsš|djo|i|ƒny|djo ||_n_|djo ||_nE|djo ||_n+|djo ||_nt|||ƒdS(NtBodyt MessageIdt ReceiptHandlet MD5OfBodytMD5OfMessageAttributes(RR R R Rtsetattr(RRtvalueR((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyt endElementgs         cCs |i|i|iƒƒƒdS(N(Rtdecodetget_body(RR((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pytendNodeuscCs|S(s8Transform body object into serialized byte array format.((RR"((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyRxscCs|S(s/Transform seralized byte array into any object.((RR"((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyR$|scCs ||_dS(s@Override the current body for this object, using decoded format.N(R(RR((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyR€scCs|iS(N(R(R((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyR%„scCs|i|iƒƒS(sí This method is really a semi-private method used by the Queue.write method when writing the contents of the message to SQS. You probably shouldn't need to call this method in the normal course of events. (RR%(R((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pytget_body_encoded‡scCs|io|ii|ƒSdS(N(Rtdelete_message(R((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pytdeletes cCs1|io#|iii|i|i|ƒndS(N(RRtchange_message_visibilityR (Rtvisibility_timeout((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pytchange_visibility“s N(t__name__t __module__t__doc__RRRRR#R&RR$RR%R'R)R,(((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyRKs          tMessagecBs eZdZd„Zd„ZRS(sz The default Message class used for SQS queues. This class automatically encodes/decodes the message body using Base64 encoding to avoid any illegal characters in the message body. See: https://forums.aws.amazon.com/thread.jspa?threadID=13067 for details on why this is a good idea. The encode/decode is meant to be transparent to the end-user. cCsti|idƒƒidƒS(Nsutf-8(tbase64t b64encodeRR$(RR"((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyR¥scCsDy%ti|idƒƒidƒ}Wntiidƒ|SX|S(Nsutf-8sUnable to decode message(R1t b64decodeRR$tbototlogtwarning(RR"((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyR$¨s %(R-R.R/RR$(((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyR0™s  t MHMessagecBs†eZdZd d d d„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zd d „ZRS(sX The MHMessage class provides a message that provides RFC821-like headers like this: HeaderName: HeaderValue The encoding/decoding of this is handled automatically and after the message body has been read, the message instance can be treated like a mapping object, i.e. m['HeaderName'] would return 'HeaderValue'. cCsA|djp |djo h}ntt|ƒi||ƒdS(NR(RtsuperR7R(RRRt xml_attrs((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyR¼s cCs yƒh}t|ƒ}|iƒ}x^|oV|idƒ}|d|!}||diƒ}|iƒ||iƒ<|iƒ}q$WWntd|ƒ‚nX|S(Nt:iisUnable to decode message(RtreadlinetfindtstripR(RR"tmsgtfptlinetdelimtkey((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyR$Ás   cCs=d}x0|iƒD]"}|d|d|df}qW|S(NRs%s: %s ii(titems(RR"tstitem((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyRÐs   cCs ||ijS(N(R(RRB((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyt __contains__ÖscCs,||ijo |i|St|ƒ‚dS(N(RtKeyError(RRB((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyt __getitem__Ùs cCs!||i|<|i|iƒdS(N(RR(RRBR"((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyt __setitem__ßs cCs |iiƒS(N(Rtkeys(R((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyRJãscCs |iiƒS(N(Rtvalues(R((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyRKæscCs |iiƒS(N(RRC(R((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyRCéscCs ||ijS(N(R(RRB((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pythas_keyìscCs$|ii|ƒ|i|iƒdS(N(RtupdateR(Rtd((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyRMïscCs|ii||ƒS(N(Rtget(RRBtdefault((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyROósN(R-R.R/RRR$RRFRHRIRJRKRCRLRMRO(((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyR7°s           tEncodedMHMessagecBs eZdZd„Zd„ZRS(sN The EncodedMHMessage class provides a message that provides RFC821-like headers like this: HeaderName: HeaderValue This variation encodes/decodes the body of the message in base64 automatically. The message instance can be treated like a mapping object, i.e. m['HeaderName'] would return 'HeaderValue'. cCsTy%ti|idƒƒidƒ}Wntd|ƒ‚nXtt|ƒi|ƒS(Nsutf-8sUnable to decode message(R1R3RR$RR8RQ(RR"((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyR$s %cCs7tt|ƒi|ƒ}ti|idƒƒidƒS(Nsutf-8(R8RQRR1R2R$(RR"((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyR s(R-R.R/R$R(((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyRQös  (R/R1R4t boto.compatRtboto.sqs.attributesRtboto.sqs.messageattributesRtboto.exceptionRtobjectRR0R7RQ(((s4/usr/lib/python2.6/site-packages/boto/sqs/message.pyt@s  NF