pyface.data_view.exporters.row_exporter module

class pyface.data_view.exporters.row_exporter.RowExporter[source]

Bases: AbstractDataExporter

Export a collection of rows from a data view as a list of lists.

This is suitable for drag and drop or copying of the content of multiple selected rows.

This exports a list of data associated with each row in the indices. Each row item is itself a list of values extracted from the model.

If the format mimetype is a text mimetype, it will use the get_text() method to extract the values, otherwise it will try to use the editor value if it exists, and failing that the raw value returned from the model.

row_headers = Bool()

Whether or not to include row headers.

column_headers = Bool()

Whether or not to include column headers.

get_data(model, indices)[source]

Get the data to be exported from the model and indices.

This exports a list of data associated with each row in the indices. Each row item is itself a list of values extracted from the model.

Parameters
  • model (AbstractDataModel) – The data model holding the data.

  • indices (list of (row, column) index pairs) – The indices where the data is to be stored.

Returns

data – The data, of a type that can be serialized by the format.

Return type

Any