spinetoolbox.project_commands
QUndoCommand subclasses for modifying the project.
Module Contents
Classes
Command to set the specification for a project item. |
|
Command to move icons in the Design view. |
|
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 add a jump between project items. |
|
Command to remove jumps. |
|
Command to set jump condition. |
|
Command to update Jump command line args. |
|
Command to toggle filter value. |
|
Command to set connection's default filter online status. |
|
Command to enable and disable connection's filter types. |
|
Command to set connection options. |
|
Command to add item specification to a project. |
|
Command to replace item specification in project. |
|
Command to remove specs from a project. |
|
Command to remove item specs from a project. |
- class spinetoolbox.project_commands.SpineToolboxCommand[source]
Bases:
PySide6.QtGui.QUndoCommand
- class spinetoolbox.project_commands.SetItemSpecificationCommand(item_name, spec, old_spec, project)[source]
Bases:
SpineToolboxCommand
Command to set the specification for a project item.
- Parameters
item_name (str) – item’s name
spec (ProjectItemSpecification) – the new spec
old_spec (ProjectItemSpecification) – the old spec
project (SpineToolboxProject) – project
- 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.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, item_factories)[source]
Bases:
SpineToolboxCommand
Command to add items.
- Parameters
project (SpineToolboxProject) – the project
items_dict (dict) – a mapping from item name to item dict
item_factories (dict) – a mapping from item type to ProjectItemFactory
silent (bool) – If True, suppress messages
- class spinetoolbox.project_commands.RemoveAllProjectItemsCommand(project, item_factories, delete_data=False)[source]
Bases:
SpineToolboxCommand
Command to remove all items from project.
- Parameters
project (SpineToolboxProject) – the project
item_factories (dict) – a mapping from item type to ProjectItemFactory
delete_data (bool) – If True, deletes the directories and data associated with the items
- class spinetoolbox.project_commands.RemoveProjectItemsCommand(project, item_factories, item_names, delete_data=False)[source]
Bases:
SpineToolboxCommand
Command to remove items.
- Parameters
project (SpineToolboxProject) – The project
item_factories (dict) – a mapping from item type to ProjectItemFactory
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 LoggingConnection) – the connections
- class spinetoolbox.project_commands.AddJumpCommand(project, source_name, source_position, destination_name, destination_position)[source]
Bases:
SpineToolboxCommand
Command to add a jump 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.RemoveJumpsCommand(project, jumps)[source]
Bases:
SpineToolboxCommand
Command to remove jumps.
- Parameters
project (SpineToolboxProject) – project
jumps (list of LoggingJump) – the jumps
- class spinetoolbox.project_commands.SetJumpConditionCommand(project, jump, jump_properties, condition)[source]
Bases:
SpineToolboxCommand
Command to set jump condition.
- Parameters
project (SpineToolboxProject) – project
jump (Jump) – target jump
jump_properties (JumpPropertiesWidget) – jump’s properties tab
condition (dict) – jump condition
- class spinetoolbox.project_commands.UpdateJumpCmdLineArgsCommand(project, jump, jump_properties, cmd_line_args)[source]
Bases:
SpineToolboxCommand
Command to update Jump command line args.
- Parameters
project (SpineToolboxProject) – project
jump (Jump) – jump
jump_properties (JumpPropertiesWidget) – the item
cmd_line_args (list) – list of command line args
- class spinetoolbox.project_commands.SetFiltersOnlineCommand(project, connection, resource, filter_type, online)[source]
Bases:
SpineToolboxCommand
Command to toggle filter value.
- Parameters
project (SpineToolboxProject) – project
connection (Connection) – connection
resource (str) – resource label
filter_type (str) – filter type identifier
online (dict) – mapping from scenario/tool id to online flag
- class spinetoolbox.project_commands.SetConnectionDefaultFilterOnlineStatus(project, connection, default_status)[source]
Bases:
SpineToolboxCommand
Command to set connection’s default filter online status.
- Parameters
project (SpineToolboxProject) – project
connection (LoggingConnection) – connection
default_status (bool) – default filter online status
- class spinetoolbox.project_commands.SetConnectionFilterTypeEnabled(project, connection, filter_type, enabled)[source]
Bases:
SpineToolboxCommand
Command to enable and disable connection’s filter types.
- Parameters
project (SpineToolboxProject) – project
connection (LoggingConnection) – connection
filter_type (str) – filter type
enabled (bool) – whether filter type is enabled
- class spinetoolbox.project_commands.SetConnectionOptionsCommand(project, connection, options)[source]
Bases:
SpineToolboxCommand
Command to set connection options.
- Parameters
project (SpineToolboxProject) – project
connection (LoggingConnection) – project
options (dict) – containing options to be set
- class spinetoolbox.project_commands.AddSpecificationCommand(project, specification, save_to_disk)[source]
Bases:
SpineToolboxCommand
Command to add item specification to a project.
- Parameters
project (ToolboxUI) – the toolbox
specification (ProjectItemSpecification) – the spec
save_to_disk (bool) – If True, save the specification to disk
- class spinetoolbox.project_commands.ReplaceSpecificationCommand(project, name, specification)[source]
Bases:
SpineToolboxCommand
Command to replace item specification in project.
- Parameters
project (ToolboxUI) – the toolbox
name (str) – the name of the spec to be replaced
specification (ProjectItemSpecification) – the new spec
- class spinetoolbox.project_commands.RemoveSpecificationCommand(project, name)[source]
Bases:
SpineToolboxCommand
Command to remove specs from a project.
- Parameters
project (SpineToolboxProject) – the project
name (str) – specification’s name
- class spinetoolbox.project_commands.SaveSpecificationAsCommand(project, name, path)[source]
Bases:
SpineToolboxCommand
Command to remove item specs from a project.
- Parameters
project (SpineToolboxProject) – the project
name (str) – specification’s name
path (str) – new specification file location