spinetoolbox.project_commands
¶
QUndoCommand subclasses for modifying the project.
- authors
Marin (KTH)
- date
12.2.2020
Module Contents¶
Classes¶
Command to set the specification for a Tool. |
|
Command to move icons in the Design view. |
|
Command to set the project name. |
|
Command to set the project description. |
|
Command to add items. |
|
Command to remove all items from project. |
|
Command to remove items. |
|
Command to rename project items. |
|
Command to add connection between project items. |
|
Command to remove links. |
|
Command to toggle filter value. |
|
Command to set connection options. |
|
Command to add item specs to a project. |
|
Command to remove item specs from a project. |
- class spinetoolbox.project_commands.SpineToolboxCommand[source]¶
Bases:
PySide2.QtWidgets.QUndoCommand
- class spinetoolbox.project_commands.SetItemSpecificationCommand(item, specification)[source]¶
Bases:
SpineToolboxCommand
Command to set the specification for a Tool.
- Parameters
item (ProjectItem) – the Item
specification (ProjectItemSpecification) – the new spec
- class spinetoolbox.project_commands.MoveIconCommand(icon, project)[source]¶
Bases:
SpineToolboxCommand
Command to move icons in the Design view.
- Parameters
icon (ProjectItemIcon) – the icon
project (SpineToolboxProject) – project
- class spinetoolbox.project_commands.SetProjectNameCommand(project, name)[source]¶
Bases:
SpineToolboxCommand
Command to set the project name.
- Parameters
project (SpineToolboxProject) – the project
name (str) – The new name
- class spinetoolbox.project_commands.SetProjectDescriptionCommand(project, description)[source]¶
Bases:
SpineToolboxCommand
Command to set the project description.
- Parameters
project (SpineToolboxProject) – the project
description (str) – The new description
- class spinetoolbox.project_commands.AddProjectItemsCommand(project, items_dict, set_selected=False, verbosity=True)[source]¶
Bases:
SpineToolboxCommand
Command to add items.
- Parameters
project (SpineToolboxProject) – the project
items_dict (dict) – a mapping from item name to item dict
set_selected (bool) – Whether to set item selected after the item has been added to project
verbosity (bool) – If True, prints message
- class spinetoolbox.project_commands.RemoveAllProjectItemsCommand(project, delete_data=False)[source]¶
Bases:
SpineToolboxCommand
Command to remove all items from project.
- Parameters
project (SpineToolboxProject) – the project
delete_data (bool) – If True, deletes the directories and data associated with the items
- class spinetoolbox.project_commands.RemoveProjectItemsCommand(project, item_names, delete_data=False)[source]¶
Bases:
SpineToolboxCommand
Command to remove items.
- Parameters
project (SpineToolboxProject) – The project
item_names (list of str) – Item names
delete_data (bool) – If True, deletes the directories and data associated with the item
- class spinetoolbox.project_commands.RenameProjectItemCommand(project, previous_name, new_name)[source]¶
Bases:
SpineToolboxCommand
Command to rename project items.
- Parameters
project (SpineToolboxProject) – the project
previous_name (str) – item’s previous name
new_name (str) – the new name
- class spinetoolbox.project_commands.AddConnectionCommand(project, source_name, source_position, destination_name, destination_position)[source]¶
Bases:
SpineToolboxCommand
Command to add connection between project items.
- Parameters
project (SpineToolboxProject) – project
source_name (str) – source item’s name
source_position (str) – link’s position on source item’s icon
destination_name (str) – destination item’s name
destination_position (str) – link’s position on destination item’s icon
- class spinetoolbox.project_commands.RemoveConnectionsCommand(project, connections)[source]¶
Bases:
SpineToolboxCommand
Command to remove links.
- Parameters
project (SpineToolboxProject) – project
connections (list of Connection) – the connections
- class spinetoolbox.project_commands.SetFiltersOnlineCommand(resource_filter_model, resource, filter_type, online)[source]¶
Bases:
SpineToolboxCommand
Command to toggle filter value.
- Parameters
resource_filter_model (ResourceFilterModel) – filter model
resource (str) – resource label
filter_type (str) – filter type identifier
online (dict) – mapping from scenario/tool id to online flag
- class spinetoolbox.project_commands.SetConnectionOptionsCommand(link, options)[source]¶
Bases:
SpineToolboxCommand
Command to set connection options.
- Parameters
link (Link) –
options (dict) – containing options to be set
- class spinetoolbox.project_commands.AddSpecificationCommand(toolbox, specification)[source]¶
Bases:
SpineToolboxCommand
Command to add item specs to a project.
- Parameters
toolbox (ToolboxUI) – the toolbox
specification (ProjectItemSpecification) – the spec
- class spinetoolbox.project_commands.RemoveSpecificationCommand(toolbox, row, ask_verification)[source]¶
Bases:
SpineToolboxCommand
Command to remove item specs from a project.
- Parameters
toolbox (ToolboxUI) – the toolbox
row (int) – the row in the ProjectItemSpecPaletteModel
ask_verification (bool) – if True, shows confirmation message the first time