Text API

API for working with the Text type.

Import this module like this:

from sympathy.api import text

Class text.File

class sympathy.typeutils.text.File(fileobj=None, data=None, filename=None, mode=u'r', scheme=u'hdf5', source=None, managed=False, import_links=False)[source]

A Text type containing arbitrary text, be it Hamlet or some json encoded data structure.

Any node port with the Text type will produce an object of this kind.

get()[source]

Return text data.

classmethod icon()[source]

Return full path to svg icon.

set(text_data)[source]

Set text data.

source(other)[source]

Copy the contents from other text.File. Equivalent to update().

update(other)[source]

Copy the contents from other text.File. Equivalent to source().

classmethod viewer()[source]

Return viewer class, which must be a subclass of sympathy.api.typeutil.ViewerBase