You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable the user to fine grain controls regarding the formatting, by implementing the __format__ magic method (see also).
Examples
error=error.ExaError(
name="E-TEST-2",
message="Fire in the server room",
mitigations=[
"Use the fire extinguisher",
"flood the room with halon gas (Attention: be sure no humans in the room!)"
],
parameters={}
)
print(error)
>E-TEST-2: FireintheserverroomKnownmitigations:
>*Usethefireextinguisher>*floodtheroomwithhalongas (Attention: besurenohumansintheroom!)
print(f'{error:name})
>E-TEST-2print(f'{error:short})
>E-TEST-2-Fireintheserverroom.
TODO's
Implement __format__
name
short
...
Add tests for formatting options
Document the formatting options
The text was updated successfully, but these errors were encountered:
Summary
Enable the user to fine grain controls regarding the formatting, by implementing the
__format__
magic method (see also).Examples
TODO's
__format__
The text was updated successfully, but these errors were encountered: