ok
Direktori : /proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/clcommon/ |
Current File : //proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/clcommon/clemail.pyc |
� b=0Yc @ s5 d d l Z d d l Z d Z d d d � � YZ d S( i����Ns Subject:t ClEmailc B s) e Z d � Z e d d d d � � Z RS( c C s d S( N( ( t self( ( s4 /usr/lib/python2.7/site-packages/clcommon/clemail.pyt __init__ s c C s� d } | p | } t j j | | � } | | k rm t j j t j j | | � � rm t j j | | � } n t j j | | � } t | d � } | j � } | j � t | � d k r| d j t � r| d d k r| d j t d � j � } | j d � | j d � n g | D] } | j d � ^ q} i d j | � | 6} t j | � } t j d | � } | j | � j | � } | | j d � f S( s\ Generates email message using jinja2 template engine :param template_dir: Base templates directory :param templ_filename: Template filename :param templ_data: Data to fill template using jinja2 :param locale_name: Locale :param subject: Email subject to use if it not found in template :return: Cortege (email_subject, email_body) t en_USt ri i i s t s utf-8t loader( t ost patht joint isfilet opent readlinest closet lent startswitht SUBJECT_LINE_PREFIXt replacet stript popt decodet jinja2t DictLoadert Environmentt get_templatet rendert encode( t template_dirt templ_filenamet templ_datat locale_namet subjectt def_localet templ_dirt template_filet f_templatet template_linest lt templ_dictt templ_loadert templ_envirt body_message( ( s4 /usr/lib/python2.7/site-packages/clcommon/clemail.pyt generate_mail_jinja2 s( . 5 "N( t __name__t __module__R t staticmethodt NoneR* ( ( ( s4 /usr/lib/python2.7/site-packages/clcommon/clemail.pyR s ( ( R R R R ( ( ( s4 /usr/lib/python2.7/site-packages/clcommon/clemail.pyt <module> s