spinetoolbox.project_commands¶
QUndoCommand subclasses for modifying the project.
| authors: |
|
|---|---|
| date: | 12.2.2020 |
Module Contents¶
-
class
spinetoolbox.project_commands.SpineToolboxCommand[source]¶ Bases:
PySide2.QtWidgets.QUndoCommand
-
class
spinetoolbox.project_commands.SetProjectNameCommand(project, name)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to set the project name.
Parameters: - project (SpineToolboxProject) – the project
- name (str) – The new name
-
class
spinetoolbox.project_commands.SetProjectDescriptionCommand(project, description)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to set the project description.
Parameters: - project (SpineToolboxProject) – the project
- description (str) – The new description
-
class
spinetoolbox.project_commands.AddProjectItemsCommand(project, category_name, *items, set_selected=False, verbosity=True)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand 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
-
class
spinetoolbox.project_commands.RemoveAllProjectItemsCommand(project, items_per_category, links, delete_data=False)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand 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.RemoveProjectItemCommand(project, name, delete_data=False)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand 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
-
class
spinetoolbox.project_commands.RenameProjectItemCommand(project_item_model, tree_item, new_name)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to rename items.
Parameters: - project_item_model (ProjectItemModel) – the project
- tree_item (LeafProjectTreeItem) – the item to rename
- new_name (str) – the new name
-
class
spinetoolbox.project_commands.AddLinkCommand(graphics_view, src_connector, dst_connector)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to add link.
Parameters: - graphics_view (DesignQGraphicsView) – the view
- src_connector (ConnectorButton) – the source connector
- dst_connector (ConnectorButton) – the destination connector
-
class
spinetoolbox.project_commands.RemoveLinkCommand(graphics_view, link)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to remove link.
Parameters: - graphics_view (DesignQGraphicsView) – the view
- link (Link) – the link
-
class
spinetoolbox.project_commands.MoveIconCommand(graphics_item)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to move icons in the Design view.
Parameters: graphics_item (ProjectItemIcon) – the icon
-
class
spinetoolbox.project_commands.AddDCReferencesCommand(dc, paths)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to add DC references.
Parameters: - dc (DataConnection) – the DC
- paths (set(str)) – set of paths to add
-
class
spinetoolbox.project_commands.RemoveDCReferencesCommand(dc, paths)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to remove DC references.
Parameters: - dc (DataConnection) – the DC
- paths (list(str)) – list of paths to remove
-
class
spinetoolbox.project_commands.UpdateDSURLCommand(ds, **kwargs)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to update DS url.
Parameters: - ds (DataStore) – the DS
- kwargs – url keys and their values
-
class
spinetoolbox.project_commands.UpdateImporterSettingsCommand(importer, settings, importee)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to update Importer settings.
Parameters: - importer (spinetoolbox.project_items.importer.importer.Importer) – the Importer
- settings (dict) – the new settings
- importee (str) – the filepath
-
class
spinetoolbox.project_commands.UpdateImporterCancelOnErrorCommand(importer, cancel_on_error)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to update Importer cancel on error setting.
Parameters: - importer (spinetoolbox.project_items.importer.importer.Importer) – the Importer
- cancel_on_error (bool) – the new setting
-
class
spinetoolbox.project_commands.SetToolSpecificationCommand(tool, specification)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to set the specification for a Tool.
Parameters: - tool (Tool) – the Tool
- specification (ToolSpecification) – the new tool spec
-
class
spinetoolbox.project_commands.UpdateToolExecuteInWorkCommand(tool, execute_in_work)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to update Tool execute_in_work setting.
Parameters: - tool (Tool) – the Tool
- execute_in_work (bool) – True or False
-
class
spinetoolbox.project_commands.UpdateToolCmdLineArgsCommand(tool, cmd_line_args)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to update Tool command line args.
Parameters: - tool (Tool) – the Tool
- cmd_line_args (list) – list of str args
-
class
spinetoolbox.project_commands.UpdateExporterOutFileNameCommand(exporter, file_name, database_path)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand 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
-
class
spinetoolbox.project_commands.UpdateExporterSettingsCommand(exporter, settings, indexing_settings, indexing_domains, merging_settings, merging_domains, database_path)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to update Exporter settings.
Parameters: - exporter (Exporter) – the Exporter
- database_path (str) – the db path to update settings for
-
class
spinetoolbox.project_commands.AddToolSpecificationCommand(toolbox, tool_specification)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to add Tool specs to a project.
Parameters: - toolbox (ToolboxUI) – the toolbox
- tool_specification (ToolSpecification) – the tool spec
-
class
spinetoolbox.project_commands.RemoveToolSpecificationCommand(toolbox, row, ask_verification)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand 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
-
class
spinetoolbox.project_commands.UpdateToolSpecificationCommand(toolbox, row, tool_specification)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand 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