spinetoolbox.import_editor.widgets.import_mappings

ImportMappings widget.

author:
  1. Vennström (VTT)
date:

1.6.2019

Module Contents

Classes

ImportMappings Provides methods for managing Mappings (add, remove, edit, visualize, and so on).
spinetoolbox.import_editor.widgets.import_mappings.MAPPING_CHOICES = ['Constant', 'Column', 'Row', 'Column Header', 'Headers', 'Table Name', 'None'][source]
class spinetoolbox.import_editor.widgets.import_mappings.ImportMappings(ui, undo_stack)[source]

Bases: PySide2.QtCore.QObject

Provides methods for managing Mappings (add, remove, edit, visualize, and so on).

Parameters:
  • ui (QWidget) – importer window’s UI
  • undo_stack (QUndoStack) – undo stack
mapping_selection_changed[source]

Emitted when a new mapping specification is selected from the Mappings list.

mapping_data_changed[source]

Emits the new MappingListModel.

about_to_undo[source]

Emitted before an undo/redo action.

set_mappings_model(self, source_table_name, model)[source]

Sets new mappings.

Parameters:
  • source_table_name (str) – source table’s name
  • model (MappingListModel) – mapping list model
focus_on_changing_specification(self, source_table_name, mapping_name)[source]

Selects the given mapping from the list and emits about_to_undo.

Parameters:
  • source_table_name (str) – name of the source table
  • mapping_name (str) – name of the mapping specification
data_changed(self)[source]

Emits the mappingDataChanged signal with the currently selected data mappings.

new_mapping(self)[source]

Pushes a CreateMapping command to the undo stack

create_mapping(self)[source]
insert_mapping_specification(self, source_table_name, name, row, mapping_specification)[source]
delete_selected_mapping(self)[source]

Pushes a DeleteMapping command to the undo stack.

delete_mapping(self, source_table_name, name)[source]
_select_row(self, row)[source]
change_mapping(self, selected, deselected)[source]