ó
º9—^c           @   sO  d  Z  y d d l m Z Wn d d l m Z n Xy d d l m Z Wn d d l m Z n Xd d l m Z m	 Z	 m
 Z
 d d l Z e e ƒ Z e ƒ  Z e j d d d g ƒd	 „  ƒ Z e j e j d d
 g ƒd „  ƒ Z e d k rKe e j j d e j ƒ ƒ Z e e j k r)e e _ n  e j d d d e j d e ƒ n  d S(   sg   Receiver module for processing SendGrid Inbound Parse messages.

See README.txt for usage instructions.iÿÿÿÿ(   t   Config(   t   Parse(   t   Flaskt   requestt   render_templateNt   /t   methodst   GETc           C   s
   t  d ƒ S(   s2   Show index page to confirm that server is running.s
   index.html(   R   (    (    (    s>   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/inbound/app.pyt   index   s    t   POSTc          C   s   t  t t ƒ }  |  j ƒ  GHd S(   s8   Process POST from Inbound Parse and print received data.t   OK(   R   t   configR   t
   key_values(   t   parse(    (    s>   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/inbound/app.pyt   inbound_parse   s    t   __main__t   PORTt   hosts   0.0.0.0t   debugt   port(   t   __doc__R   R    t   sendgrid.helpers.inbound.configR   R   t   sendgrid.helpers.inbound.parset   flaskR   R   R   t   ost   __name__t   appt   routeR   t   endpointR   t   intt   environt   getR   t   FalseR   t   runt
   debug_mode(    (    (    s>   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/inbound/app.pyt   <module>   s&   	!$