safe.messaging.item.message_element module

InaSAFE Disaster risk assessment tool by AusAid - Message Element.

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.item.message_element.MessageElement(element_id=None, style_class=None, icon=None, attributes=None)[source]

Bases: object

html_attributes()[source]

Get extra html attributes such as id and class.

html_icon()[source]

Get bootstrap style glyphicon.

For glyphicons see http://twitter.github.io/bootstrap/base-css .html#icons

e.g. icon=’icon-search’ when used will cause self.html_icon to return
<i class=”icon-search”></i>
to_html()[source]

Render a MessageElement queue as html

Returns:Html representation of the Text MessageElement.
Return type:str
to_json()[source]

Render a MessageElement queue as JSON

Returns:Json representation of the Text MessageElement.
Return type:str
to_markdown()[source]

Render a MessageElement queue as markdown

Returns:Markdown representation of the Text MessageElement.
Return type:str
to_text()[source]

Render a MessageElement queue as text

Returns:Text representation of the Text MessageElement.
Return type:str