spinetoolbox.spine_db_commands
¶
QUndoCommand subclasses for modifying the db.
- authors
Marin (KTH)
- date
31.1.2020
Module Contents¶
Classes¶
|
|
|
|
|
|
|
|
|
|
|
|
|
Functions¶
|
|
|
- class spinetoolbox.spine_db_commands.AgedUndoCommand(parent=None)[source]¶
Bases:
PySide2.QtWidgets.QUndoCommand
- Parameters
parent (QUndoCommand, optional) – The parent command, used for defining macros.
- class spinetoolbox.spine_db_commands.SpineDBCommand(db_mngr, db_map, parent=None)[source]¶
Bases:
AgedUndoCommand
- Parameters
db_mngr (SpineDBManager) – SpineDBManager instance
db_map (DiffDatabaseMapping) – DiffDatabaseMapping instance
parent (QUndoCommand, optional) – The parent command, used for defining macros.
- static redomethod(func)[source]¶
Returns a new redo method that determines if the command was completed. The command is completed if calling the function triggers the
completed_signal
. Once the command is completed, we don’t listen to the signal anymore and we also silence the affected Spine db editors. If the signal is not received, then the command is declared obsolete.
- class spinetoolbox.spine_db_commands.AddItemsCommand(db_mngr, db_map, data, item_type, parent=None)[source]¶
Bases:
SpineDBCommand
- Parameters
db_mngr (SpineDBManager) – SpineDBManager instance
db_map (DiffDatabaseMapping) – DiffDatabaseMapping instance
data (list) – list of dict-items to add
item_type (str) – the item type
parent (QUndoCommand, optional) – The parent command, used for defining macros.
- class spinetoolbox.spine_db_commands.CheckAddParameterValuesCommand(db_mngr, db_map, data, parent=None)[source]¶
Bases:
AddItemsCommand
- Parameters
db_mngr (SpineDBManager) – SpineDBManager instance
db_map (DiffDatabaseMapping) – DiffDatabaseMapping instance
data (list) – list of dict-items to add
item_type (str) – the item type
parent (QUndoCommand, optional) – The parent command, used for defining macros.
- class spinetoolbox.spine_db_commands.UpdateItemsCommand(db_mngr, db_map, data, item_type, parent=None)[source]¶
Bases:
SpineDBCommand
- Parameters
db_mngr (SpineDBManager) – SpineDBManager instance
db_map (DiffDatabaseMapping) – DiffDatabaseMapping instance
data (list) – list of dict-items to update
item_type (str) – the item type
parent (QUndoCommand, optional) – The parent command, used for defining macros.
- class spinetoolbox.spine_db_commands.CheckUpdateParameterValuesCommand(db_mngr, db_map, data, parent=None)[source]¶
Bases:
UpdateItemsCommand
- Parameters
db_mngr (SpineDBManager) – SpineDBManager instance
db_map (DiffDatabaseMapping) – DiffDatabaseMapping instance
data (list) – list of dict-items to update
item_type (str) – the item type
parent (QUndoCommand, optional) – The parent command, used for defining macros.
- class spinetoolbox.spine_db_commands.RemoveItemsCommand(db_mngr, db_map, typed_data, parent=None)[source]¶
Bases:
SpineDBCommand
- Parameters
db_mngr (SpineDBManager) – SpineDBManager instance
db_map (DiffDatabaseMapping) – DiffDatabaseMapping instance
typed_data (dict) – lists of dict-items to remove keyed by string type
parent (QUndoCommand, optional) – The parent command, used for defining macros.