ó
O'—^c           @@  sI   d  Z  d d l m Z d d l m Z d g Z d e f d „  ƒ  YZ d S(   s   Messages for AMQPi    (   t   absolute_importi   (   t   GenericContentt   Messagec           B@  sY   e  Z d  Z d d d d d d d d d d d d  d! d" g Z d d# d# d „ Z d „  Z RS($   s4   A Message for use with the Channnel.basic_* methods.t   content_typet   shortstrt   content_encodingt   application_headerst   tablet   delivery_modet   octett   priorityt   correlation_idt   reply_tot
   expirationt
   message_idt	   timestampt   typet   user_idt   app_idt
   cluster_idt    c         K@  s,   t  t |  ƒ j |   | |  _ | |  _ d S(   sm  Expected arg types

            body: string
            children: (not supported)

        Keyword properties may include:

            content_type: shortstr
                MIME content type

            content_encoding: shortstr
                MIME content encoding

            application_headers: table
                Message header field table, a dict with string keys,
                and string | int | Decimal | datetime | dict values.

            delivery_mode: octet
                Non-persistent (1) or persistent (2)

            priority: octet
                The message priority, 0 to 9

            correlation_id: shortstr
                The application correlation identifier

            reply_to: shortstr
                The destination to reply to

            expiration: shortstr
                Message expiration specification

            message_id: shortstr
                The application message identifier

            timestamp: datetime.datetime
                The message timestamp

            type: shortstr
                The message type name

            user_id: shortstr
                The creating user id

            app_id: shortstr
                The creating application id

            cluster_id: shortstr
                Intra-cluster routing identifier

        Unicode bodies are encoded according to the 'content_encoding'
        argument. If that's None, it's set to 'UTF-8' automatically.

        example::

            msg = Message('hello world',
                            content_type='text/plain',
                            application_headers={'foo': 7})

        N(   t   superR   t   __init__t   bodyt   channel(   t   selfR   t   childrenR   t
   properties(    (    s4   /tmp/pip-unpacked-wheel-9igm28/amqp/basic_message.pyR   /   s    =	c         C@  sE   y, t  t |  ƒ j | ƒ o* |  j | j k SWn t k
 r@ t SXd S(   sÈ   Check if the properties and bodies of this Message and another
        Message are the same.

        Received messages may contain a 'delivery_info' attribute,
        which isn't compared.

        N(   R   R   t   __eq__R   t   AttributeErrort   NotImplemented(   R   t   other(    (    s4   /tmp/pip-unpacked-wheel-9igm28/amqp/basic_message.pyR   p   s
    (   R   R   (   R   R   (   R   R   (   R   R	   (   R
   R	   (   R   R   (   R   R   (   R   R   (   R   R   (   R   R   (   R   R   (   R   R   (   R   R   (   R   R   N(   t   __name__t
   __module__t   __doc__t
   PROPERTIESt   NoneR   R   (    (    (    s4   /tmp/pip-unpacked-wheel-9igm28/amqp/basic_message.pyR      s"   	AN(   R"   t
   __future__R    t   serializationR   t   __all__R   (    (    (    s4   /tmp/pip-unpacked-wheel-9igm28/amqp/basic_message.pyt   <module>   s   	