U
    ä«Fc³  ã                   @   sö   d Z zddlmZ W n   ddlmZ Y nX zddlmZ W n   ddlmZ Y nX ddlmZm	Z	m
Z
 ddlZeeƒZeƒ Zejddgd�d	d
„ ƒZejejdgd�dd„ ƒZedkròeej dej¡ƒZeejkràde_ejdejed� dS )zgReceiver module for processing SendGrid Inbound Parse messages.

See README.txt for usage instructions.é    )ÚConfig)ÚParse)ÚFlaskÚrequestÚrender_templateNú/ÚGET)Úmethodsc                   C   s   t dƒS )z2Show index page to confirm that server is running.z
index.html)r   © r
   r
   ú@/tmp/pip-unpacked-wheel-7j3043uk/sendgrid/helpers/inbound/app.pyÚindex   s    r   ÚPOSTc                  C   s   t ttƒ} t|  ¡ ƒ dS )z8Process POST from Inbound Parse and print received data.ÚOK)r   Úconfigr   ÚprintÚ
key_values)Úparser
   r
   r   Úinbound_parse   s    
r   Ú__main__ZPORTFz0.0.0.0)ÚhostÚdebugÚport)Ú__doc__r   r   Zsendgrid.helpers.inbound.configr   r   Zsendgrid.helpers.inbound.parseZflaskr   r   r   ÚosÚ__name__ZappZrouter   Zendpointr   ÚintÚenvironÚgetr   r   ÚrunZ
debug_moder
   r
   r
   r   Ú<module>   s*   



