module render.renderer
¶
Properties¶
property |
truncated documentation |
---|---|
returns |
Methods¶
method |
truncated documentation |
---|---|
constructor, defines a template based on Jinja2 |
|
flushes all files |
|
render a mail |
|
writes a mail, the function assumes the attachments were already dumped |
Documentation¶
@file @brief Functions to dump emails
-
class
pymmails.render.renderer.
Renderer
(tmpl, css, style_table='dataframe100l', style_highlight='dataframe100l_hl', buffer_write=None, fLOG=<function noLOG>)¶ Bases:
object
defines way to render an email
constructor, defines a template based on Jinja2
@param tmpl template (string or file) @param css style @param style_table style for the table @param style_highlight style for highlighted cells @param buffer_write instance of class @see cl BufferFilesWriting
-
property
BufferWrite
¶ returns
self._buffer_write
-
__init__
(tmpl, css, style_table='dataframe100l', style_highlight='dataframe100l_hl', buffer_write=None, fLOG=<function noLOG>)¶ constructor, defines a template based on Jinja2
@param tmpl template (string or file) @param css style @param style_table style for the table @param style_highlight style for highlighted cells @param buffer_write instance of class @see cl BufferFilesWriting
-
flush
()¶ flushes all files
@return number of bytes written
-
render
(location, obj, attachments=None, file_css='mail_style.css')¶ render a mail
@paramp location location where this mail should be saved @param obj instance of an object @param file_css css file (where it is supposed to be stored) @param attachments attachments @return html, css (content)
The mail is stored in object
message
,css
means the style sheet,render
means this object,location
means location,attachments
is attachments:{{ message.get_subject() }}
The value stored in file_css will be relative to location.
-
write
(location, mail, filename, attachments=None, overwrite=False, file_css='mail_style.css', encoding='utf8')¶ writes a mail, the function assumes the attachments were already dumped
@param location location @param mail instance of an object or an iterator @param attachments list of attachments (see @see me dump_attachments) @param overwrite the function does not overwrite @param file_css css file (where it is supposed to be stored) @param encoding encoding @return list of written local files
-
property