ó
:ÏOc        	   @   sµ   d  d l  m Z d  d l m Z d Z d e f d „  ƒ  YZ d e d „ Z d „  Z	 d „  Z
 d „  Z d e d „ Z d e d „ Z d e d „ Z d e d „ Z d e d „ Z d S(   iÿÿÿÿ(   t	   constants(   t   default_storaget   add_messaget   get_messagest	   get_levelt	   set_levelt   debugt   infot   successt   warningt   errort   MessageFailurec           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s4   ../Django//lib/python/django/contrib/messages/api.pyR      s   t    c         C   s>   t  |  d ƒ r% |  j j | | | ƒ S| s: t d ƒ ‚ n  d S(   sL   
    Attempts to add a message to the request using the 'messages' app.
    t	   _messagess_   You cannot add messages without installing django.contrib.messages.middleware.MessageMiddlewareN(   t   hasattrR   t   addR   (   t   requestt   levelt   messaget
   extra_tagst   fail_silently(    (    s4   ../Django//lib/python/django/contrib/messages/api.pyR      s    c         C   s   t  |  d ƒ r |  j Sg  Sd S(   sg   
    Returns the message storage on the request if it exists, otherwise returns
    an empty list.
    R   N(   R   R   (   R   (    (    s4   ../Django//lib/python/django/contrib/messages/api.pyR      s    c         C   s.   t  |  d ƒ r |  j } n t |  ƒ } | j S(   s®   
    Returns the minimum level of messages to be recorded.

    The default level is the ``MESSAGE_LEVEL`` setting. If this is not found,
    the ``INFO`` level is used.
    R   (   R   R   R   R   (   R   t   storage(    (    s4   ../Django//lib/python/django/contrib/messages/api.pyR   %   s    c         C   s#   t  |  d ƒ s t S| |  j _ t S(   s×   
    Sets the minimum level of messages to be recorded, returning ``True`` if
    the level was recorded successfully.

    If set to ``None``, the default level will be used (see the ``get_level``
    method).
    R   (   R   t   FalseR   R   t   True(   R   R   (    (    s4   ../Django//lib/python/django/contrib/messages/api.pyR   3   s    c         C   s#   t  |  t j | d | d | ƒd S(   s2   
    Adds a message with the ``DEBUG`` level.
    R   R   N(   R   R    t   DEBUG(   R   R   R   R   (    (    s4   ../Django//lib/python/django/contrib/messages/api.pyR   A   s    c         C   s#   t  |  t j | d | d | ƒd S(   s1   
    Adds a message with the ``INFO`` level.
    R   R   N(   R   R    t   INFO(   R   R   R   R   (    (    s4   ../Django//lib/python/django/contrib/messages/api.pyR   I   s    c         C   s#   t  |  t j | d | d | ƒd S(   s4   
    Adds a message with the ``SUCCESS`` level.
    R   R   N(   R   R    t   SUCCESS(   R   R   R   R   (    (    s4   ../Django//lib/python/django/contrib/messages/api.pyR   Q   s    c         C   s#   t  |  t j | d | d | ƒd S(   s4   
    Adds a message with the ``WARNING`` level.
    R   R   N(   R   R    t   WARNING(   R   R   R   R   (    (    s4   ../Django//lib/python/django/contrib/messages/api.pyR	   Y   s    c         C   s#   t  |  t j | d | d | ƒd S(   s2   
    Adds a message with the ``ERROR`` level.
    R   R   N(   R   R    t   ERROR(   R   R   R   R   (    (    s4   ../Django//lib/python/django/contrib/messages/api.pyR
   a   s    N(	   s   add_messages   get_messagess	   get_levels	   set_levels   debugs   infos   successs   warnings   error(   t   django.contrib.messagesR    t   django.contrib.messages.storageR   t   __all__t	   ExceptionR   R   R   R   R   R   R   R   R   R	   R
   (    (    (    s4   ../Django//lib/python/django/contrib/messages/api.pyt   <module>   s     			