ó
NXc           @   sĄ   d  d l  Z  d  d l Z d  d l Z e j   d  d l Z d  d l Z d  d l Z d  d l m Z d  d l	 m
 Z
 d   Z d   Z e d k r e d  n  d S(   iĸĸĸĸN(   t   unquote_plus(   t   strftimec         C   s  d } d } d } d } d d d g } d } d t  j   d	 d
 |  d | } d }	 t j |  }
 | r |
 j | |  |
 j | | |  }	 n |
 j | | |  }	 |
 j   |	 rd } x: |	 j   D], } d | |	 | d |	 | d	 | f } qĖ Wt j |  n  d  S(   Nt	   localhosti    t    s   contact@frostwire.coms   erika.acosta.torres@gmail.coms   gubatron@gmail.coms   noreply@frostwire.coms   From: FrostWire Bug Manager (i   s#   ) <noreply@frostwire.com>
Subject: s   

s6   Could not delivery mail to: %s

Server said: %s
%s

%s(	   t   ost   unamet   smtplibt   SMTPt   logint   sendmailt   quitt   keyst   SMTPException(   t   subjectt   messaget
   smtpservert   AUTHREQUIREDt   smtpusert   smtppasst
   RECIPIENTSt   SENDERt   mssgt
   smtpresultt   sessiont   errstrt   recip(    (    sK   /mnt/ebs/frostwire-files/frostwire-cloud/com/frostwire/doctor/bugmanager.pyt	   sendemail
   s&    $
*c         C   s,   t  |   } t d t d  |  d GHd S(   Ns   [FrostWire-Bugs] Bug-report  s   %Y-%m-%d %H:%M:%Ss   bugmanager::reportbug()!i   (   R    R   R   (   R   t   finalmsg(    (    sK   /mnt/ebs/frostwire-files/frostwire-cloud/com/frostwire/doctor/bugmanager.pyt	   reportbug-   s    t   __main__s   This is a test bug message(   t   stringt   cgit   cgitbt   enablet   sysR   R   t   urllibR    t   timeR   R   R   t   __name__(    (    (    sK   /mnt/ebs/frostwire-files/frostwire-cloud/com/frostwire/doctor/bugmanager.pyt   <module>   s    
	#	