Provides generic text views
This modules provides several generic views for serializing models into human-readable text.
oslo_reports.views.text.generic.
BasicKeyValueView
¶Bases: object
A Basic Key-Value Text View
This view performs a naive serialization of a model into text using a basic key-value method, where each key-value pair is rendered as “key = str(value)”
oslo_reports.views.text.generic.
KeyValueView
(indent_str=' ', key_sep=' = ', dict_sep=' = ', list_sep=' = ', anon_dict='[dict]', before_dict=None, before_list=None)¶Bases: object
A Key-Value Text View
This view performs an advanced serialization of a model into text by following the following set of rules:
rootkey =
serialize(key, value)
key =
serialize(item)
Parameters: |
|
---|
oslo_reports.views.text.generic.
MultiView
¶Bases: object
A Text View Containing Multiple Views
This view simply serializes each value in the data model, and then joins them with newlines (ignoring the key values altogether). This is useful for serializing lists of models (as array-like dicts).
oslo_reports.views.text.generic.
TableView
(column_names, column_values, table_prop_name)¶Bases: object
A Basic Table Text View
This view performs serialization of data into a basic table with predefined column names and mappings. Column width is auto-calculated evenly, column values are automatically truncated accordingly. Values are centered in the columns.
Parameters: |
|
---|
Text Views With Headers
This package defines several text views with headers
oslo_reports.views.text.header.
HeaderView
(header)¶Bases: object
A Text View With a Header
This view simply serializes the model and places the given header on top.
Parameters: | header – the header (can be anything on which str() can be called) |
---|
oslo_reports.views.text.header.
TitledView
(title)¶Bases: oslo_reports.views.text.header.HeaderView
A Text View With a Title
This view simply serializes the model, and places a preformatted header containing the given title text on top. The title text can be up to 64 characters long.
Parameters: | title (str) – the title of the view |
---|
FORMAT_STR
= '========================================================================\n===={0: ^64}====\n========================================================================'¶Provides process view
This module provides a view for visualizing processes in human-readable form
oslo_reports.views.text.process.
ProcessView
(path=None, text=None)¶Bases: oslo_reports.views.jinja_view.JinjaView
A Process View
This view displays process models defined by
oslo_reports.models.process.ProcessModel
VIEW_TEXT
= "Process {{ pid }} (under {{ parent_pid }}) [ run by: {{ username }} ({{ uids.real|default('unknown uid') }}), state: {{ state }} ]\n{% for child in children %} {{ child }}{% endfor %}"¶Provides thread and stack-trace views
This module provides a collection of views for visualizing threads, green threads, and stack traces in human-readable form.
oslo_reports.views.text.threading.
GreenThreadView
¶Bases: object
A Green Thread View
This view displays a green thread provided by the data
model oslo_reports.models.threading.GreenThreadModel
FORMAT_STR
= '------{thread_str: ^60}------\n{stack_trace}'¶oslo_reports.views.text.threading.
StackTraceView
(path=None, text=None)¶Bases: oslo_reports.views.jinja_view.JinjaView
A Stack Trace View
This view displays stack trace models defined by
oslo_reports.models.threading.StackTraceModel
VIEW_TEXT
= '{% if root_exception is not none %}Exception: {{ root_exception }}\n------------------------------------\n\n{% endif %}{% for line in lines %}\n{{ line.filename }}:{{ line.line }} in {{ line.name }}\n {% if line.code is not none %}`{{ line.code }}`{% else %}(source not found){% endif %}\n{% else %}\nNo Traceback!\n{% endfor %}'¶oslo_reports.views.text.threading.
ThreadView
¶Bases: object
A Thread Collection View
This view displays a python thread provided by the data
model oslo_reports.models.threading.ThreadModel
# noqa
FORMAT_STR
= '------{thread_str: ^60}------\n{stack_trace}'¶Provides basic text views
This module provides several basic views which serialize models into human-readable text.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.