
    xhU                     6    d Z ddlZddlZ G d de          ZdS )z@Set up credentials (.env) and application variables (config.yml)    Nc                       e Zd ZdZd Zed             Zed             Zed             Z	ed             Z
ed             Zed             Zd	S )
Configz-All configuration for this app is loaded herec                 l   t           j                            d          dk    r|                                  	 |                    dt           j                            t           j                            t                                        | _        t          d	                    | j                            5 }t          j        |t          j                  }|d         | _        |d         | _        |d         | _        |d	         | _        |d
         | _        d d d            d S # 1 swxY w Y   d S )NENVprodpathz{0}/config.yml)Loader
debug_modeendpointhostkeysport)osenvirongetinit_environmentr   abspathdirname__file__openformatyamlload
FullLoader_debug_mode	_endpoint_host_keys_port)selfoptsstreamconfigs       R/var/www/html/what/lib/python3.11/site-packages/sendgrid/helpers/inbound/config.py__init__zConfig.__init__	   s:   :>>%  F**!!###	HHBGOOBGOOH$=$=>>
 
	 "))$)4455 	(Yvdo>>>F%l3D#J/DNDJDJDJ	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(s   :A"D))D-0D-c                  "   t           j                            t           j                            t                              } d                    |           }t           j                            |          rt          |          5 }|                                }|D ]W}|	                                
                    d          }t          |          dk    r|d         t           j        |d         <   X	 ddd           dS # 1 swxY w Y   dS dS )zVAllow variables assigned in .env available using
           os.environ.get('VAR_NAME')z{0}/.env=      r   N)r   r   r   r   r   r   existsr   	readlinesstripsplitlenr   )	base_pathenv_pathflineslinevars         r$   r   zConfig.init_environment   s%    GOOBGOOH$=$=>>	$$Y//7>>(## 	4h 41! 4 4D**,,,,S11C3xx1}}-0V
3q6*44 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4	4 	4s   A/DD	Dc                     | j         S )z.Flask debug mode - set to False in production.)r   r    s    r$   r
   zConfig.debug_mode(   s         c                     | j         S )z(Endpoint to receive Inbound Parse POSTs.)r   r6   s    r$   r   zConfig.endpoint-   s     ~r7   c                     | j         S )z!URL that the sender will POST to.)r   r6   s    r$   r   zConfig.host2        zr7   c                     | j         S )zIncoming Parse fields to parse. For reference, see
        https://sendgrid.com/docs/Classroom/Basics/Inbound_Parse_Webhook/setting_up_the_inbound_parse_webhook.html
        )r   r6   s    r$   r   zConfig.keys7   s    
 zr7   c                     | j         S )zPort to listen on.)r   r6   s    r$   r   zConfig.port>   r:   r7   N)__name__
__module____qualname____doc__r%   staticmethodr   propertyr
   r   r   r   r    r7   r$   r   r      s        77( ( (" 4 4 \4     X    X   X   X   X  r7   r   )r@   r   r   objectr   rC   r7   r$   <module>rE      sQ    F F 				 ; ; ; ; ;V ; ; ; ; ;r7   