oslo_reports.views.text.generic
Module¶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: |
|
---|
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.