/usr/lib/python2.7/dist-packages/pika/amqp_object.py is in python-pika 0.9.14-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | """Base classes that are extended by low level AMQP frames and higher level
AMQP classes and methods.
"""
class AMQPObject(object):
"""Base object that is extended by AMQP low level frames and AMQP classes
and methods.
"""
NAME = 'AMQPObject'
INDEX = None
def __repr__(self):
items = list()
for key, value in self.__dict__.items():
if getattr(self.__class__, key, None) != value:
items.append('%s=%s' % (key, value))
if not items:
return "<%s>" % self.NAME
return "<%s(%s)>" % (self.NAME, sorted(items))
class Class(AMQPObject):
"""Is extended by AMQP classes"""
NAME = 'Unextended Class'
class Method(AMQPObject):
"""Is extended by AMQP methods"""
NAME = 'Unextended Method'
synchronous = False
def _set_content(self, properties, body):
"""If the method is a content frame, set the properties and body to
be carried as attributes of the class.
:param pika.frame.Properties properties: AMQP Basic Properties
:param body: The message body
:type body: str or unicode
"""
self._properties = properties
self._body = body
def get_properties(self):
"""Return the properties if they are set.
:rtype: pika.frame.Properties
"""
return self._properties
def get_body(self):
"""Return the message body if it is set.
:rtype: str|unicode
"""
return self._body
class Properties(AMQPObject):
"""Class to encompass message properties (AMQP Basic.Properties)"""
NAME = 'Unextended Properties'
|