ó
rÁìVc           @   sí   d  d l  Z  d  d l m Z d  d l m Z d d l m Z y d  d l m Z d „  Z	 Wn! e
 k
 r| d  d l m	 Z	 n Xd	 d
 „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e ƒ  j d d ƒ Z e e ƒ Z d S(   iÿÿÿÿN(   t   settings(   t   InvalidCacheBackendErrori   (   t   import_attribute(   t   cachesc         C   s   t  |  S(   N(   R   (   t   name(    (    sm   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/django_post_office-2.0.6-py2.7.egg/post_office/settings.pyt	   get_cache   s    (   R   t   defaultc         C   s   t  ƒ  |  S(   N(   t   get_available_backends(   t   alias(    (    sm   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/django_post_office-2.0.6-py2.7.egg/post_office/settings.pyt   get_backend   s    c          C   sŒ   t  ƒ  j d i  ƒ }  |  r |  St  ƒ  j d ƒ } | rU t j d t ƒ | |  d <|  St t d d ƒ |  d <d |  d k rˆ d |  d <n  |  S(   sÔ    Returns a dictionary of defined backend classes. For example:
    {
        'default': 'django.core.mail.backends.smtp.EmailBackend',
        'locmem': 'django.core.mail.backends.locmem.EmailBackend',
    }
    t   BACKENDSt   EMAIL_BACKENDs3   Please use the new POST_OFFICE["BACKENDS"] settingsR   s+   django.core.mail.backends.smtp.EmailBackends   post_office.EmailBackend(   t
   get_configt   gett   warningst   warnt   DeprecationWarningt   getattrR    (   t   backendst   backend(    (    sm   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/django_post_office-2.0.6-py2.7.egg/post_office/settings.pyR      s    	
c           C   sQ   t  t d ƒ rM d t j k r( t d ƒ Sy t d ƒ SWqM t k
 rI qM Xn  d  S(   Nt   CACHESt   post_officeR   (   t   hasattrR    R   R   R   t   None(    (    (    sm   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/django_post_office-2.0.6-py2.7.egg/post_office/settings.pyt   get_cache_backend;   s    
c           C   s   t  t d i  ƒ S(   s}   
    Returns Post Office's configuration in dictionary format. e.g:
    POST_OFFICE = {
        'BATCH_SIZE': 1000
    }
    t   POST_OFFICE(   R   R    (    (    (    sm   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/django_post_office-2.0.6-py2.7.egg/post_office/settings.pyR   H   s    c           C   s   t  ƒ  j d d ƒ S(   Nt
   BATCH_SIZEiˆ  (   R   R   (    (    (    sm   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/django_post_office-2.0.6-py2.7.egg/post_office/settings.pyt   get_batch_sizeR   s    c           C   s   t  ƒ  j d d ƒ S(   Nt   DEFAULT_PRIORITYt   medium(   R   R   (    (    (    sm   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/django_post_office-2.0.6-py2.7.egg/post_office/settings.pyt   get_default_priorityV   s    c           C   s   t  ƒ  j d d ƒ S(   Nt	   LOG_LEVELi   (   R   R   (    (    (    sm   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/django_post_office-2.0.6-py2.7.egg/post_office/settings.pyt   get_log_levelZ   s    c           C   s   t  ƒ  j d d g ƒ S(   Nt   SENDING_ORDERs	   -priority(   R   R   (    (    (    sm   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/django_post_office-2.0.6-py2.7.egg/post_office/settings.pyt   get_sending_order^   s    t   CONTEXT_FIELD_CLASSs   jsonfield.JSONField(   R   t   django.confR    t   django.core.cache.backends.baseR   t   compatR   t   django.core.cacheR   R   t   ImportErrorR	   R   R   R   R   R   R    R"   R   R#   t   context_field_class(    (    (    sm   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/django_post_office-2.0.6-py2.7.egg/post_office/settings.pyt   <module>   s&   	%		
					