safe.messaging.item.table module

InaSAFE Disaster risk assessment tool developed by AusAid - Table

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.table.Table(*args, **kwargs)[source]

Bases: safe.messaging.item.message_element.MessageElement

A class to model tables in the messaging system

add(item)[source]

Add a row to the table.

List can be passed and are automatically converted to Rows

Parameters:item (row, list) – Item an element to add to the rows can be list or Row object
to_html()[source]

Render a Table MessageElement as html

Returns:The html representation of the Table MessageElement
Return type:basestring
to_json()[source]

Render a Table queue as JSON

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

Render a Table queue as markdown

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

Render a Table MessageElement as plain text

Returns:The text representation of the Table MessageElement
Return type:basestring