Example #1
0
 def __init__(self, queue=None, body=''):
     self.queue = queue
     self.set_body(body)
     self.id = None
     self.receipt_handle = None
     self.md5 = None
     self.attributes = Attributes(self)
Example #2
0
 def get_queue_attributes(self, queue_url, attribute='All'):
     params = {'Attribute': attribute}
     response = self.make_request('GetQueueAttributes', params, queue_url)
     body = response.read()
     if response.status == 200:
         attrs = Attributes()
         h = handler.XmlHandler(attrs, self)
         xml.sax.parseString(body, h)
         return attrs
     else:
         raise SQSError(response.status, response.reason, body)