ó b=0Yc@s5ddlZddlZdZddd„ƒYZdS(iÿÿÿÿNsSubject:tClEmailcBs)eZd„Zedddd„ƒZRS(cCsdS(N((tself((s4/usr/lib/python2.7/site-packages/clcommon/clemail.pyt__init__ scCs™d}|p|}tjj||ƒ}||krmtjjtjj||ƒƒ rmtjj||ƒ}ntjj||ƒ}t|dƒ}|jƒ} |jƒt| ƒdkr| djt ƒr| ddkr| dj t dƒj ƒ}| j dƒ| j dƒng| D]} | j dƒ^q} idj| ƒ|6} tj| ƒ} tjd | ƒ} | j|ƒj|ƒ}||jdƒfS( 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) ten_UStriiis tsutf-8tloader(tostpathtjointisfiletopent readlinestclosetlent startswithtSUBJECT_LINE_PREFIXtreplacetstriptpoptdecodetjinja2t DictLoadert Environmentt get_templatetrendertencode(t template_dirttempl_filenamet templ_datat locale_nametsubjectt def_localet templ_dirt template_filet f_templatettemplate_linestlt templ_dictt templ_loadert templ_envirt body_message((s4/usr/lib/python2.7/site-packages/clcommon/clemail.pytgenerate_mail_jinja2s(  .  5  "N(t__name__t __module__Rt staticmethodtNoneR*(((s4/usr/lib/python2.7/site-packages/clcommon/clemail.pyR s ((RRRR(((s4/usr/lib/python2.7/site-packages/clcommon/clemail.pyts