ó
º9—^c           @   s8   d  Z  d d l Z d d l Z d e f d „  ƒ  YZ d S(   s@   Set up credentials (.env) and application variables (config.yml)iÿÿÿÿNt   Configc           B   sq   e  Z d  Z d „  Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z	 e d „  ƒ Z
 e d „  ƒ Z RS(   s-   All configuration for this app is loaded herec         K   sÇ   t  j j d ƒ d k r% |  j ƒ  n  | j d t  j j t  j j t ƒ ƒ ƒ |  _ t d j	 |  j ƒ ƒ W } t
 j | ƒ } | d |  _ | d |  _ | d |  _ | d |  _ | d	 |  _ Wd  QXd  S(
   Nt   ENVt   prodt   paths   {0}/config.ymlt
   debug_modet   endpointt   hostt   keyst   port(   t   ost   environt   gett   init_environmentR   t   abspatht   dirnamet   __file__t   opent   formatt   yamlt   loadt   _debug_modet	   _endpointt   _hostt   _keyst   _port(   t   selft   optst   streamt   config(    (    sA   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/inbound/config.pyt   __init__	   s    'c       	   C   s·   t  j j t  j j t ƒ ƒ }  d j |  ƒ } t  j j | ƒ r³ t | ƒ c } | j ƒ  } xM | D]E } | j	 ƒ  j
 d ƒ } t | ƒ d k ra | d t  j | d <qa qa WWd QXn  d S(   sV   Allow variables assigned in .env available using
           os.environ.get('VAR_NAME')s   {0}/.envt   =i   i   i    N(   R	   R   R   R   R   R   t   existsR   t	   readlinest   stript   splitt   lenR
   (   t	   base_patht   env_patht   ft   linest   linet   var(    (    sA   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/inbound/config.pyR      s    c         C   s   |  j  S(   s.   Flask debug mode - set to False in production.(   R   (   R   (    (    sA   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/inbound/config.pyR   (   s    c         C   s   |  j  S(   s(   Endpoint to receive Inbound Parse POSTs.(   R   (   R   (    (    sA   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/inbound/config.pyR   -   s    c         C   s   |  j  S(   s!   URL that the sender will POST to.(   R   (   R   (    (    sA   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/inbound/config.pyR   2   s    c         C   s   |  j  S(   s®   Incoming Parse fields to parse. For reference, see
        https://sendgrid.com/docs/Classroom/Basics/Inbound_Parse_Webhook/setting_up_the_inbound_parse_webhook.html
        (   R   (   R   (    (    sA   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/inbound/config.pyR   7   s    c         C   s   |  j  S(   s   Port to listen on.(   R   (   R   (    (    sA   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/inbound/config.pyR   >   s    (   t   __name__t
   __module__t   __doc__R   t   staticmethodR   t   propertyR   R   R   R   R   (    (    (    sA   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/inbound/config.pyR       s   	(   R,   R	   R   t   objectR    (    (    (    sA   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/inbound/config.pyt   <module>   s   