관리-도구
편집 파일: clemail.cpython-311.pyc
� P�Cg� � �4 � d dl Z d dlZdZ G d� d� � ZdS )� NzSubject:c �0 � e Zd ZdZd� Zedd�� � ZdS )�ClEmailz- class for generation email messages c � � d S �N� )�selfs ��/builddir/build/BUILDROOT/alt-python27-cllib-3.4.17-1.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/clemail.py�__init__zClEmail.__init__ s � ��� Nc � � t j t j � | � � � � }t j |�� � }|� t j � | � � � � � |� � � d� � }t |� � dk r�|d � t � � ri|d dk r]|d � t d� � � � � }|� d� � |� d� � |d� |� � fS )a8 Generates email message using jinja2 template engine :param template_path: path to jinja2 template :param templ_data: Data to fill template using jinja2 :param subject: Email subject to use if it not found in template :return: Cortege (email_subject, email_body) )�loader� � r � � )�jinja2�FileSystemLoader�os�path�dirname�Environment�get_template�basename�render�split�len� startswith�SUBJECT_LINE_PREFIX�replace�strip�pop�join)� template_path� templ_data�subject�templ_loader�templ_envir� message_liness r �generate_mail_jinja2zClEmail.generate_mail_jinja2 s# � � �.�r�w���}�/M�/M�N�N���(��=�=�=��#�0�0��G���]�+�+� � � �&�� � � �%��+�+� � �}����!�!�m�A�&6�&A�&A�BU�&V�&V�!�[h�ij�[k�oq�[q�[q�#�A�&�.�.�/B�B�G�G�M�M�O�O�G����a� � � ����a� � � ��� � �-�0�0�0�0r r )�__name__� __module__�__qualname__�__doc__r �staticmethodr) r r r r r sM � � � � � �� � � � � �1� 1� 1� �\�1� 1� 1r r )r r r r r r r �<module>r/ sS �� � � � � � � � � !� � 1� 1� 1� 1� 1� 1� 1� 1� 1� 1r