spinetoolbox.project_items.data_connection.data_connection
¶
Module for data connection class.
author: |
|
---|---|
date: | 19.12.2017 |
Module Contents¶
-
class
spinetoolbox.project_items.data_connection.data_connection.
DataConnection
(name, description, x, y, toolbox, project, logger, references=None)[source]¶ Bases:
spinetoolbox.project_item.ProjectItem
Data Connection class.
Parameters: - name (str) – Object name
- description (str) – Object description
- x (float) – Initial X coordinate of item icon
- y (float) – Initial Y coordinate of item icon
- toolbox (ToolboxUI) – QMainWindow instance
- project (SpineToolboxProject) – the project this item belongs to
- logger (LoggerInterface) – a logger instance
- references (list) – a list of file paths
-
make_signal_handler_dict
(self)[source]¶ Returns a dictionary of all shared signals and their handlers. This is to enable simpler connecting and disconnecting.
-
restore_selections
(self)[source]¶ Restore selections into shared widgets when this project item is selected.
-
add_files_to_references
(self, paths)[source]¶ Add multiple file paths to reference list.
Parameters: paths (list) – A list of paths to files
-
receive_files_dropped_on_icon
(self, icon, file_paths)[source]¶ Called when files are dropped onto a data connection graphics item. If the item is this Data Connection’s graphics item, add the files to data.
-
add_references
(self, checked=False)[source]¶ Let user select references to files for this data connection.
-
remove_references
(self, checked=False)[source]¶ Remove selected references from reference list. Do not remove anything if there are no references selected.
-
copy_to_project
(self, checked=False)[source]¶ Copy selected file references to this Data Connection’s data directory.
-
datapackage_form_destroyed
(self)[source]¶ Notify a connection that datapackage form has been destroyed.
-
file_references
(self)[source]¶ Returns a list of paths to files that are in this item as references.
-
refresh
(self, path=None)[source]¶ Refresh data files in Data Connection Properties. NOTE: Might lead to performance issues.
-
populate_reference_list
(self, items, emit_item_changed=True)[source]¶ List file references in QTreeView. If items is None or empty list, model is cleared.
-
populate_data_list
(self, items)[source]¶ List project internal data (files) in QTreeView. If items is None or empty list, model is cleared.
-
update_name_label
(self)[source]¶ Update Data Connection tab name label. Used only when renaming project items.
-
rename
(self, new_name)[source]¶ Rename this item.
Parameters: new_name (str) – New name Returns: True if renaming succeeded, False otherwise Return type: bool