fgen_runtime.formatting#
Formatting of fgen wrapped objects
get_attribute_str_value#
- get_attribute_str_value(instance, attribute)[source]#
Get the string version of an attribute’s value
- Parameters:
instance (
fgen_runtime.base.FinalizableWrapperBase
) – Instance from which to get the attributeattribute (
str
) – Attribute for which to get the value
- Returns:
str
– String version of the attribute’s value, with graceful handling of errors.
to_str#
- to_str(instance, exposed_attributes)[source]#
Convert an instance to its string representation
- Parameters:
instance (
fgen_runtime.base.FinalizableWrapperBase
) – Instance to convertexposed_attributes (
collections.abc.Iterable
[str
]) – Attributes from Fortran that the instance exposes
- Returns:
str
– String representation of the instance
to_pretty#
- to_pretty(instance, exposed_attributes, p, cycle, indent=4)[source]#
Pretty-print an instance
- Parameters:
instance (
fgen_runtime.base.FinalizableWrapperBase
) – Instance to convertexposed_attributes (
collections.abc.Iterable
[str
]) – Attributes from Fortran that the instance exposesp (
typing.Any
) – Pretty printing objectcycle (
bool
) – Whether the pretty printer has detected a cycle or not.indent (
int
) – Indent to apply to the pretty printing group
- Return type:
add_attribute_row#
to_html#
- to_html(instance, exposed_attributes)[source]#
Convert an instance to its html representation
- Parameters:
instance (
fgen_runtime.base.FinalizableWrapperBase
) – Instance to convertexposed_attributes (
collections.abc.Iterable
[str
]) – Attributes from Fortran that the instance exposes
- Returns:
str
– HTML representation of the instance