ó
O'—^c           @@  sã   d  Z  d d l m Z d d l m Z m Z d d l m Z d d l m	 Z	 d d l
 m Z d Z d Z i e d	 6e d
 6Z d d d g Z d „  Z d „  Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d S(   sB   
kombu.entity
================

Exchange and Queue declarations.

i    (   t   absolute_importi   (   t   MaybeChannelBoundt   Object(   t   ContentDisallowed(   t   string_t(   t   prepare_accept_contenti   t	   transientt
   persistentt   Exchanget   Queuet   bindingc         C@  s@   t  |  ƒ }  t |  t ƒ r5 |  j d ƒ r5 |  d d !S|  d d !S(   Ns   u'i   iÿÿÿÿi   (   t   reprt
   isinstanceR   t
   startswith(   t   s(    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   _reprstr   s    c         C@  s   d d j  t t |  ƒ ƒ S(   Ns   [%s]s   , (   t   joint   mapt   str(   t   bindings(    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   pretty_bindings   s    c           B@  sL  e  Z d  Z e Z e Z d Z d Z e Z e	 Z
 e	 Z e Z d d d d e f d e f d e f d	 d
 „  f f Z d d d d „ Z d „  Z e	 d d „ Z d d d e	 d „ Z d d e	 d d „ Z d d d d d d d „ Z d e	 e	 d d „ Z e	 e	 d „ Z d d d d „ Z d „  Z d „  Z d „  Z d „  Z e d „  ƒ Z RS(   s  An Exchange declaration.

    :keyword name: See :attr:`name`.
    :keyword type: See :attr:`type`.
    :keyword channel: See :attr:`channel`.
    :keyword durable: See :attr:`durable`.
    :keyword auto_delete: See :attr:`auto_delete`.
    :keyword delivery_mode: See :attr:`delivery_mode`.
    :keyword arguments: See :attr:`arguments`.

    .. attribute:: name

        Name of the exchange. Default is no name (the default exchange).

    .. attribute:: type

        *This description of AMQP exchange types was shamelessly stolen
        from the blog post `AMQP in 10 minutes: Part 4`_ by
        Rajith Attapattu. Reading this article is recommended if you're
        new to amqp.*

        "AMQP defines four default exchange types (routing algorithms) that
        covers most of the common messaging use cases. An AMQP broker can
        also define additional exchange types, so see your broker
        manual for more information about available exchange types.

            * `direct` (*default*)

                Direct match between the routing key in the message, and the
                routing criteria used when a queue is bound to this exchange.

            * `topic`

                Wildcard match between the routing key and the routing pattern
                specified in the exchange/queue binding. The routing key is
                treated as zero or more words delimited by `"."` and
                supports special wildcard characters. `"*"` matches a
                single word and `"#"` matches zero or more words.

            * `fanout`

                Queues are bound to this exchange with no arguments. Hence any
                message sent to this exchange will be forwarded to all queues
                bound to this exchange.

            * `headers`

                Queues are bound to this exchange with a table of arguments
                containing headers and values (optional). A special argument
                named "x-match" determines the matching algorithm, where
                `"all"` implies an `AND` (all pairs must match) and
                `"any"` implies `OR` (at least one pair must match).

                :attr:`arguments` is used to specify the arguments.


            .. _`AMQP in 10 minutes: Part 4`:
                http://bit.ly/amqp-exchange-types

    .. attribute:: channel

        The channel the exchange is bound to (if bound).

    .. attribute:: durable

        Durable exchanges remain active when a server restarts. Non-durable
        exchanges (transient exchanges) are purged when a server restarts.
        Default is :const:`True`.

    .. attribute:: auto_delete

        If set, the exchange is deleted when all queues have finished
        using it. Default is :const:`False`.

    .. attribute:: delivery_mode

        The default delivery mode used for messages. The value is an integer,
        or alias string.

            * 1 or `"transient"`

                The message is transient. Which means it is stored in
                memory only, and is lost if the server dies or restarts.

            * 2 or "persistent" (*default*)
                The message is persistent. Which means the message is
                stored both in-memory, and on disk, and therefore
                preserved if the server dies or restarts.

        The default value is 2 (persistent).

    .. attribute:: arguments

        Additional arguments to specify when the exchange is declared.

    t    t   directt   namet   typet	   argumentst   durablet   passivet   auto_deletet   delivery_modec         C@  s   t  j |  ƒ p |  S(   N(   t   DELIVERY_MODESt   get(   t   m(    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   <lambda>”   R   c         K@  sK   t  t |  ƒ j |   | p" |  j |  _ | p4 |  j |  _ |  j | ƒ d  S(   N(   t   superR   t   __init__R   R   t
   maybe_bind(   t   selfR   R   t   channelt   kwargs(    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR#   —   s    c         C@  s   t  d |  j f ƒ S(   Ns   E|%s(   t   hashR   (   R%   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   __hash__   s    c         C@  sn   | d k r |  j n | } |  j rj |  j j d |  j d |  j d |  j d |  j d |  j d | d | ƒ Sd S(	   sØ   Declare the exchange.

        Creates the exchange on the broker.

        :keyword nowait: If set the server will not respond, and a
            response will not be waited for. Default is :const:`False`.

        t   exchangeR   R   R   R   t   nowaitR   N(	   t   NoneR   R   R&   t   exchange_declareR   R   R   R   (   R%   R+   R   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   declare    s    		c         K@  sI   t  | t ƒ r | j } n  |  j j d |  j d | d | d | d | ƒ S(   sË   Binds the exchange to another exchange.

        :keyword nowait: If set the server will not respond, and the call
            will not block waiting for a response.  Default is :const:`False`.

        t   destinationt   sourcet   routing_keyR+   R   (   R   R   R   R&   t   exchange_bind(   R%   R*   R1   R   R+   R'   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   bind_to±   s    c         C@  sI   t  | t ƒ r | j } n  |  j j d |  j d | d | d | d | ƒ S(   s;   Delete previously created exchange binding from the server.R/   R0   R1   R+   R   (   R   R   R   R&   t   exchange_unbind(   R%   R0   R1   R+   R   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   unbind_fromÁ   s    c   	      C@  s   | d	 k r i  n | } | p$ |  j } | d k rI | d k rI t | n | | d <|  j j | d | d | d | d | d | ƒS(
   sæ  Create message instance to be sent with :meth:`publish`.

        :param body: Message body.

        :keyword delivery_mode: Set custom delivery mode. Defaults
            to :attr:`delivery_mode`.

        :keyword priority: Message priority, 0 to 9. (currently not
            supported by RabbitMQ).

        :keyword content_type: The messages content_type. If content_type
            is set, no serialization occurs as it is assumed this is either
            a binary object, or you've done your own serialization.
            Leave blank if using built-in serialization as our library
            properly sets content_type.

        :keyword content_encoding: The character set in which this object
            is encoded. Use "binary" if sending in raw binary objects.
            Leave blank if using built-in serialization as our library
            properly sets content_encoding.

        :keyword properties: Message properties.

        :keyword headers: Message headers.

        i   i   R   t
   propertiest   priorityt   content_typet   content_encodingt   headersN(   R,   R   R   R&   t   prepare_message(	   R%   t   bodyR   R7   R8   R9   R6   R:   t   dm(    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   MessageÌ   s    ,c      
   C@  s7   | p |  j  } |  j j | d | d | d | d | ƒS(   sç   Publish message.

        :param message: :meth:`Message` instance to publish.
        :param routing_key: Routing key.
        :param mandatory: Currently not supported.
        :param immediate: Currently not supported.

        R*   R1   t	   mandatoryt	   immediate(   R   R&   t   basic_publish(   R%   t   messageR1   R?   R@   R*   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   publishô   s    
c         C@  s"   |  j  j d |  j d | d | ƒ S(   s1  Delete the exchange declaration on server.

        :keyword if_unused: Delete only if the exchange has no bindings.
            Default is :const:`False`.

        :keyword nowait: If set the server will not respond, and a
            response will not be waited for. Default is :const:`False`.

        R*   t	   if_unusedR+   (   R&   t   exchange_deleteR   (   R%   RD   R+   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   delete  s    
c         C@  s   t  |  | | | ƒ S(   N(   R
   (   R%   R1   R   t   unbind_arguments(    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR
     s    c         C@  s}   t  | t ƒ ry |  j | j k ox |  j | j k ox |  j | j k ox |  j | j k ox |  j | j k ox |  j | j k St S(   N(	   R   R   R   R   R   R   R   R   t   NotImplemented(   R%   t   other(    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   __eq__  s    c         C@  s   |  j  | ƒ S(   N(   RJ   (   R%   RI   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   __ne__   s    c         C@  s   t  t |  ƒ j t |  ƒ ƒ S(   N(   R"   R   t   __repr__R   (   R%   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyRL   #  s    c         C@  s&   d t  |  j ƒ p t d ƒ |  j f S(   Ns   Exchange %s(%s)R   (   R   R   R   R   (   R%   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   __str__&  s    c         C@  s   |  j  S(   N(   R   (   R%   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   can_cache_declaration)  s    N(   R   N(   R   N(   R   N(   t   __name__t
   __module__t   __doc__t   TRANSIENT_DELIVERY_MODEt   PERSISTENT_DELIVERY_MODER   R   t   TrueR   t   FalseR   R   R   R,   t   boolt   attrsR#   R)   R.   R3   R5   R>   RC   RF   R
   RJ   RK   RL   RM   t   propertyRN   (    (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR   "   sF   `				
&	
			c           B@  sk   e  Z d  Z d d d d f Z d d d d d „ Z e d „ Z e d „ Z e d	 „ Z	 d
 „  Z
 d „  Z RS(   s
  Represents a queue or exchange binding.

    :keyword exchange: Exchange to bind to.
    :keyword routing_key: Routing key used as binding key.
    :keyword arguments: Arguments for bind operation.
    :keyword unbind_arguments: Arguments for unbind operation.

    R*   R1   R   RG   R   c         C@  s(   | |  _  | |  _ | |  _ | |  _ d  S(   N(   R*   R1   R   RG   (   R%   R*   R1   R   RG   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR#   ?  s    			c         C@  s;   |  j  r7 |  j  j r7 |  j  | ƒ } | j d | ƒ n  d S(   s   Declare destination exchange.R+   N(   R*   R   R.   (   R%   R&   R+   t   ex(    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR.   F  s    c      	   C@  s/   | j  d |  j d |  j d |  j d | ƒ d S(   s   Bind entity to this binding.R*   R1   R   R+   N(   R3   R*   R1   R   (   R%   t   entityR+   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   bindL  s    		c         C@  s,   | j  |  j d |  j d |  j d | ƒd S(   s    Unbind entity from this binding.R1   R   R+   N(   R5   R*   R1   RG   (   R%   RZ   R+   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   unbindS  s    		c         C@  s   d |  f S(   Ns   <binding: %s>(    (   R%   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyRL   Z  s    c         C@  s#   d t  |  j j ƒ t  |  j ƒ f S(   Ns   %s->%s(   R   R*   R   R1   (   R%   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyRM   ]  s    N(   R*   N(   R1   N(   R   N(   RG   N(   RO   RP   RQ   R,   RW   R#   RU   R.   R[   R\   RL   RM   (    (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR
   .  s   		c           B@  s©  e  Z d  Z e Z d Z e d ƒ Z d Z e Z	 e
 Z e
 Z e
 Z d# d$ d% d& d' d e f d e f d	 e f d( d) d e f f Z d d" d d" d" d" d „ Z d „  Z d „  Z d „  Z e
 d „ Z e
 e
 d „ Z e
 d „ Z d d d" e
 d „ Z d" d" d „ Z e
 d „ Z d d" d" e
 d „ Z d „  Z e
 e
 e
 d „ Z d" e
 d „ Z d d d" e
 d „ Z  d „  Z! d „  Z" d „  Z# e$ d „  ƒ Z% e& d  „  ƒ Z' e
 d! „ Z( RS(*   sg  A Queue declaration.

    :keyword name: See :attr:`name`.
    :keyword exchange: See :attr:`exchange`.
    :keyword routing_key: See :attr:`routing_key`.
    :keyword channel: See :attr:`channel`.
    :keyword durable: See :attr:`durable`.
    :keyword exclusive: See :attr:`exclusive`.
    :keyword auto_delete: See :attr:`auto_delete`.
    :keyword queue_arguments: See :attr:`queue_arguments`.
    :keyword binding_arguments: See :attr:`binding_arguments`.
    :keyword on_declared: See :attr:`on_declared`

    .. attribute:: name

        Name of the queue. Default is no name (default queue destination).

    .. attribute:: exchange

        The :class:`Exchange` the queue binds to.

    .. attribute:: routing_key

        The routing key (if any), also called *binding key*.

        The interpretation of the routing key depends on
        the :attr:`Exchange.type`.

            * direct exchange

                Matches if the routing key property of the message and
                the :attr:`routing_key` attribute are identical.

            * fanout exchange

                Always matches, even if the binding does not have a key.

            * topic exchange

                Matches the routing key property of the message by a primitive
                pattern matching scheme. The message routing key then consists
                of words separated by dots (`"."`, like domain names), and
                two special characters are available; star (`"*"`) and hash
                (`"#"`). The star matches any word, and the hash matches
                zero or more words. For example `"*.stock.#"` matches the
                routing keys `"usd.stock"` and `"eur.stock.db"` but not
                `"stock.nasdaq"`.

    .. attribute:: channel

        The channel the Queue is bound to (if bound).

    .. attribute:: durable

        Durable queues remain active when a server restarts.
        Non-durable queues (transient queues) are purged if/when
        a server restarts.
        Note that durable queues do not necessarily hold persistent
        messages, although it does not make sense to send
        persistent messages to a transient queue.

        Default is :const:`True`.

    .. attribute:: exclusive

        Exclusive queues may only be consumed from by the
        current connection. Setting the 'exclusive' flag
        always implies 'auto-delete'.

        Default is :const:`False`.

    .. attribute:: auto_delete

        If set, the queue is deleted when all consumers have
        finished using it. Last consumer can be cancelled
        either explicitly or because its channel is closed. If
        there was no consumer ever on the queue, it won't be
        deleted.

    .. attribute:: queue_arguments

        Additional arguments used when declaring the queue.

    .. attribute:: binding_arguments

        Additional arguments used when binding the queue.

    .. attribute:: alias

        Unused in Kombu, but applications can take advantage of this.
        For example to give alternate names to queues with automatically
        generated queue names.

    .. attribute:: on_declared

        Optional callback to be applied when the queue has been
        declared (the ``queue_declare`` operation is complete).
        This must be a function with a signature that accepts at least 3
        positional arguments: ``(name, messages, consumers)``.

    R   R   R*   R1   t   queue_argumentst   binding_argumentsR   t	   exclusiveR   t   no_ackt   aliasR   c         K@  sÕ   t  t |  ƒ j |   | p" |  j |  _ | p4 |  j |  _ | pF |  j |  _ t | pX g  ƒ |  _ | |  _ t	 | t
 t t f ƒ rš |  j t | ƒ O_ n  |  j r¯ d  |  _ n  |  j rÄ t |  _ n  |  j | ƒ d  S(   N(   R"   R	   R#   R   R*   R1   t   setR   t   on_declaredR   t   listt   tupleR,   R_   RT   R   R$   (   R%   R   R*   R1   R&   R   Rc   R'   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR#   â  s    			c         C@  s.   |  j  } t t |  ƒ j | ƒ } | | _  | S(   N(   Rc   R"   R	   R[   (   R%   R&   Rc   t   bound(    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR[   ÷  s    		c         C@  s   t  d |  j f ƒ S(   Ns   Q|%s(   R(   R   (   R%   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR)   ý  s    c         C@  s%   |  j  r! |  j  |  j ƒ |  _  n  d  S(   N(   R*   R&   (   R%   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt
   when_bound   s    	c         C@  s’   |  j  r |  j  j | ƒ n  |  j | d t ƒ|  j  rT |  j  j rT |  j | ƒ n  x4 |  j D]) } | j |  j ƒ | j |  d | ƒq^ W|  j S(   sM   Declares the queue, the exchange and binds the queue to
        the exchange.R   R+   (	   R*   R.   t   queue_declareRU   R   t
   queue_bindR   R&   R[   (   R%   R+   t   B(    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR.     s    	c         C@  s~   |  j  j d |  j d | d |  j d |  j d |  j d |  j d | ƒ } |  j sa | d |  _ n  |  j rz |  j | Œ  n  | S(	   s  Declare queue on the server.

        :keyword nowait: Do not wait for a reply.
        :keyword passive: If set, the server will not create the queue.
            The client can use this to check whether a queue exists
            without modifying the server state.

        t   queueR   R   R_   R   R   R+   i    (   R&   Rh   R   R   R_   R   R]   Rc   (   R%   R+   R   t   ret(    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyRh     s    								c         C@  s"   |  j  |  j |  j |  j d | ƒS(   s'   Create the queue binding on the server.R+   (   R3   R*   R1   R^   (   R%   R+   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyRi   +  s    c         C@  sI   t  | t ƒ r | j } n  |  j j d |  j d | d | d | d | ƒ S(   NRk   R*   R1   R   R+   (   R   R   R   R&   Ri   (   R%   R*   R1   R   R+   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR3   0  s    c         C@  s›   | d k r |  j n | } |  j j d |  j d | ƒ } | d k	 r— t |  j d d ƒ } | ro | | ƒ } n  | j r… | j ƒ  n  t | ƒ | _	 n  | S(   s  Poll the server for a new message.

        Must return the message if a message was available,
        or :const:`None` otherwise.

        :keyword no_ack: If enabled the broker will automatically
            ack messages.
        :keyword accept: Custom list of accepted content types.

        This method provides direct access to the messages in a
        queue using a synchronous dialogue, designed for
        specific types of applications where synchronous functionality
        is more important than performance.

        Rk   R`   t   message_to_pythonN(
   R,   R`   R&   t	   basic_getR   t   getattrt   errorst   _reraise_errorR   t   accept(   R%   R`   Rr   RB   t   m2p(    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR   :  s    	c         C@  s"   |  j  j d |  j d | ƒ p! d S(   s)   Remove all ready messages from the queue.Rk   R+   i    (   R&   t   queue_purgeR   (   R%   R+   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   purgeU  s    c         C@  sL   | d k r |  j } n  |  j j d |  j d | d | p< d d | d | ƒ S(   sa  Start a queue consumer.

        Consumers last as long as the channel they were created on, or
        until the client cancels them.

        :keyword consumer_tag: Unique identifier for the consumer. The
          consumer tag is local to a connection, so two clients
          can use the same consumer tags. If this field is empty
          the server will generate a unique tag.

        :keyword no_ack: If enabled the broker will automatically ack
            messages.

        :keyword nowait: Do not wait for a reply.

        :keyword callback: callback called for each delivered message

        Rk   R`   t   consumer_tagR   t   callbackR+   N(   R,   R`   R&   t   basic_consumeR   (   R%   Rv   Rw   R`   R+   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   consumeZ  s    c         C@  s   |  j  j | ƒ S(   s"   Cancel a consumer by consumer tag.(   R&   t   basic_cancel(   R%   Rv   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   cancelv  s    c      	   C@  s(   |  j  j d |  j d | d | d | ƒ S(   s  Delete the queue.

        :keyword if_unused: If set, the server will only delete the queue
            if it has no consumers. A channel error will be raised
            if the queue has consumers.

        :keyword if_empty: If set, the server will only delete the queue
            if it is empty. If it is not empty a channel error will be raised.

        :keyword nowait: Do not wait for a reply.

        Rk   RD   t   if_emptyR+   (   R&   t   queue_deleteR   (   R%   RD   R|   R+   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyRF   z  s    c         C@  s   |  j  |  j |  j | | ƒ S(   N(   R5   R*   R1   (   R%   R   R+   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   queue_unbindŒ  s    c         C@  s1   |  j  j d |  j d | j d | d | d | ƒ S(   s5   Unbind queue by deleting the binding from the server.Rk   R*   R1   R   R+   (   R&   R~   R   (   R%   R*   R1   R   R+   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR5     s
    	c         C@  s¡   t  | t ƒ r |  j | j k oœ |  j | j k oœ |  j | j k oœ |  j | j k oœ |  j | j k oœ |  j | j k oœ |  j | j k oœ |  j	 | j	 k St
 S(   N(   R   R	   R   R*   R1   R]   R^   R   R_   R   RH   (   R%   RI   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyRJ   ™  s    c         C@  s   |  j  | ƒ S(   N(   RJ   (   R%   RI   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyRK   ¥  s    c         C@  sz   t  t |  ƒ j } |  j rI | d j d t |  j ƒ d t |  j ƒ ƒ ƒ S| d j |  d t |  j ƒ d t |  j ƒ ƒƒ S(   Ns   Queue {name} -> {bindings}R   R   s/   Queue {name} -> {0.exchange!r} -> {routing_key}R1   (	   R"   R	   RL   R   t   formatR   R   R   R1   (   R%   R   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyRL   ¨  s    	c         C@  s   |  j  S(   N(   R   (   R%   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyRN   ¶  s    c         K@  s´  | j  d ƒ p | j  d ƒ } | j  d ƒ } | d  k rK | j  d ƒ } n  | j  d ƒ } | d  k rx | j  d ƒ } n  | j  d ƒ } | d  k r¥ | j  d ƒ } n  | j  d ƒ } | d  k rÒ | j  d ƒ } n  | j  d	 ƒ } | j  d
 ƒ }	 | j  d ƒ }
 | j  d ƒ } t | j  d ƒ d | j  d ƒ d | j  d ƒ d | j  d ƒ d | d | d | ƒ} t | d | d | d | d | j  d ƒ d | d | j  d ƒ d
 |	 d |
 d | ƒ	S(   Nt   binding_keyR1   t   exchange_durableR   t   exchange_auto_deleteR   t   queue_durablet   queue_auto_deletet   exchange_argumentsR]   R^   R   R*   R   t   exchange_typeR   R   R_   R`   (   R   R,   R   R	   (   R%   Rk   t   optionsR€   t	   e_durablet   e_auto_deletet	   q_durablet   q_auto_deletet   e_argumentst   q_argumentst   b_argumentsR   R*   (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt	   from_dictº  sD    		c         C@  sg   t  t |  ƒ j | ƒ } | s" | S| j d ƒ } | rc g  | D] } | j d t ƒ ^ q> | d <n  | S(   NR   t   recurse(   R"   R	   t   as_dictR   RT   (   R%   R   t   resR   t   b(    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR‘   å  s    ,N(   R   N(   R*   N(   R1   N(   R]   N(   R^   N(   R`   N(   Ra   N()   RO   RP   RQ   R   R   R   R*   R1   RT   R   RU   R_   R   R`   R,   RV   Rd   RW   R#   R[   R)   Rg   R.   Rh   Ri   R3   R   Ru   Ry   R{   RF   R~   R5   RJ   RK   RL   RX   RN   t   classmethodR   R‘   (    (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyR	   c  sZ   e												+N(   RQ   t
   __future__R    t   abstractR   R   t
   exceptionsR   t   fiveR   t   serializationR   RR   RS   R   t   __all__R   R   R   R
   R	   (    (    (    s.   /tmp/pip-unpacked-wheel-UAnTfW/kombu/entity.pyt   <module>   s    

		ÿ 5