spinetoolbox.project_commands

QUndoCommand subclasses for modifying the project.

authors:
  1. Marin (KTH)
date:

12.2.2020

Module Contents

class spinetoolbox.project_commands.SpineToolboxCommand[source]

Bases: PySide2.QtWidgets.QUndoCommand

static is_critical()[source]

Returns True if this command needs to be undone before closing the project without saving changes.

class spinetoolbox.project_commands.SetProjectNameCommand(project, name)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to set the project name.

Parameters:
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.SetProjectDescriptionCommand(project, description)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to set the project description.

Parameters:
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.AddProjectItemsCommand(project, category_name, *items, set_selected=False, verbosity=True)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to add items.

Parameters:
  • project (SpineToolboxProject) – the project
  • category_name (str) – The items’ category
  • items (dict) – one or more dict of items to add
  • set_selected (bool) – Whether to set item selected after the item has been added to project
  • verbosity (bool) – If True, prints message
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.RemoveAllProjectItemsCommand(project, items_per_category, links, delete_data=False)[source]

Bases: spinetoolbox.project_commands.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
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.RemoveProjectItemCommand(project, name, delete_data=False)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to remove items.

Parameters:
  • project (SpineToolboxProject) – the project
  • name (str) – Item’s name
  • delete_data (bool) – If True, deletes the directories and data associated with the item
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.RenameProjectItemCommand(project_item_model, tree_item, new_name)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to rename items.

Parameters:
redo(self)[source]
undo(self)[source]
static is_critical()[source]
class spinetoolbox.project_commands.AddLinkCommand(graphics_view, src_connector, dst_connector)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to add link.

Parameters:
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.RemoveLinkCommand(graphics_view, link)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to remove link.

Parameters:
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.MoveIconCommand(graphics_item)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to move icons in the Design view.

Parameters:graphics_item (ProjectItemIcon) – the icon
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.AddDCReferencesCommand(dc, paths)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to add DC references.

Parameters:
  • dc (DataConnection) – the DC
  • paths (set(str)) – set of paths to add
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.RemoveDCReferencesCommand(dc, paths)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to remove DC references.

Parameters:
  • dc (DataConnection) – the DC
  • paths (list(str)) – list of paths to remove
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.UpdateDSURLCommand(ds, **kwargs)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to update DS url.

Parameters:
  • ds (DataStore) – the DS
  • kwargs – url keys and their values
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.UpdateImporterSettingsCommand(importer, settings, importee)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to update Importer settings.

Parameters:
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.UpdateImporterCancelOnErrorCommand(importer, cancel_on_error)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to update Importer cancel on error setting.

Parameters:
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.SetToolSpecificationCommand(tool, specification)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to set the specification for a Tool.

Parameters:
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.UpdateToolExecuteInWorkCommand(tool, execute_in_work)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to update Tool execute_in_work setting.

Parameters:
  • tool (Tool) – the Tool
  • execute_in_work (bool) – True or False
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.UpdateToolCmdLineArgsCommand(tool, cmd_line_args)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to update Tool command line args.

Parameters:
  • tool (Tool) – the Tool
  • cmd_line_args (list) – list of str args
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.UpdateExporterOutFileNameCommand(exporter, file_name, database_path)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to update Exporter output file name.

Parameters:
  • exporter (Exporter) – the Exporter
  • export_list_item (ExportListItem) – the widget that holds the name
  • file_name (str) – the output filename
  • database_path (str) – the associated db path
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.UpdateExporterSettingsCommand(exporter, settings, indexing_settings, indexing_domains, merging_settings, merging_domains, database_path)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to update Exporter settings.

Parameters:
  • exporter (Exporter) – the Exporter
  • database_path (str) – the db path to update settings for
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.AddToolSpecificationCommand(toolbox, tool_specification)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to add Tool specs to a project.

Parameters:
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.RemoveToolSpecificationCommand(toolbox, row, ask_verification)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to remove Tool specs from a project.

Parameters:
  • toolbox (ToolboxUI) – the toolbox
  • row (int) – the row in the ToolSpecificationModel
  • ask_verification (bool) – if True, shows confirmation message the first time
redo(self)[source]
undo(self)[source]
class spinetoolbox.project_commands.UpdateToolSpecificationCommand(toolbox, row, tool_specification)[source]

Bases: spinetoolbox.project_commands.SpineToolboxCommand

Command to update Tool specs in a project.

Parameters:
  • toolbox (ToolboxUI) – the toolbox
  • row (int) – the row in the ToolSpecificationModel of the spec to be replaced
  • tool_specification (ToolSpecification) – the updated tool spec
redo(self)[source]
undo(self)[source]