safe.messaging.error_message module

InaSAFE Disaster risk assessment tool developed by AusAid - Message Modele.

Contact : ole.moller.nielsen@gmail.com

Note

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

class safe.messaging.error_message.ErrorMessage(problem, detail=None, suggestion=None, traceback=None, **kwargs)[source]

Bases: safe.messaging.item.message_element.MessageElement

Standard error message

append(error_message)[source]

Add an ErrorMessage to the end of the queue.

Tracebacks are not appended.

Parameters:error_message (ErrorMessage) – An element to add to the message.
clear()[source]

Clear ErrorMessage.

prepend(error_message)[source]

Add an ErrorMessage to the beginning of the queue.

Tracebacks are not prepended.

Parameters:error_message (ErrorMessage) – An element to add to the message.
standard_suggestions()[source]

Standard generic suggestions.

Returns:List of standard suggestions for users who encounter errors.
Return type:BulletedList
to_html(in_div_flag=False)[source]

Render a ErrorMessage queue as html.

Parameters:in_div_flag (Boolean) – Whether the message should be placed into a div element.
Returns:Html representation of the error message.
Return type:str
to_text()[source]

Render an ErrorMessage as plain text.

Returns:Plain text representation of the error message.
Return type:str