scistag.vislog.visual_log_renderer.VisualLogRenderer¶
- class VisualLogRenderer[source]¶
Bases:
objectDefines an abstract interface for adding data to a log of any format
Methods
Assembles the sub logs and uses the body pieces to combine it to a delivarable files
Slices the new html template into pieces which can be quickly assembled to the full page using pre-encoded binary data.
Combines the head's header, body and footer to a full html page
Changes the current body template
Sets a new footer template
Sets a new header template
Sets the new list of sub logs to be integrated
Attributes
__dict____doc____module____weakref__list of weak references to the object (if defined)
The original body template to be parsed by Jinja
The rendered template with only place holders for content remaining
The single (binary_) pre-rendered body pieces or place holder names
The names of the single sub logs to be inserted into the body template
The pages title
The template for the top of the page
The template for the foot of the page
The encoded and rendered header
The encoded and rendered footer
- build_body(sub_log_data)[source]¶
Assembles the sub logs and uses the body pieces to combine it to a delivarable files
- build_body_pieces()[source]¶
Slices the new html template into pieces which can be quickly assembled to the full page using pre-encoded binary data.
- build_page(body)[source]¶
Combines the head’s header, body and footer to a full html page
- Parameters
body – The page’s body
- Return type
- Returns
The full, deliverable page
- set_body_template(template, **params)[source]¶
Changes the current body template
- Parameters
template (
str) – The new Jinja templatesub_logs – The names of the sub logs to be inserted
params – Optional creation parameters
Sets a new footer template
- Parameters
template (
str) – The template’s string dataparams – Parameters of content to be inserted
- set_header_template(template, **params)[source]¶
Sets a new header template
- Parameters
template (
str) – The template’s string dataparams – Parameters of content to be inserted
- set_sub_logs(sub_logs)[source]¶
Sets the new list of sub logs to be integrated
- Parameters
sub_logs – The name of the sub logs to be integrated into the final page.
- body_template¶
The original body template to be parsed by Jinja
- body_template_rendered¶
The rendered template with only place holders for content remaining
The encoded and rendered footer
The template for the foot of the page
- sub_log_names¶
The names of the single sub logs to be inserted into the body template
- title¶
The pages title