spinetoolbox.spine_db_worker
¶
The SpineDBWorker class
- authors
Vennström (VTT) and M. Marin (KTH)
- date
2.10.2019
Module Contents¶
Classes¶
Does all the DB communication for SpineDBManager, in the non-GUI thread. |
- class spinetoolbox.spine_db_worker.SpineDBWorker(db_mngr)[source]¶
Bases:
PySide2.QtCore.QObject
Does all the DB communication for SpineDBManager, in the non-GUI thread.
- _add_or_update_items(self, db_map_data, method_name, getter_name, signal_name)[source]¶
Adds or updates items in db.
- Parameters
db_map_data (dict) – lists of items to add or update keyed by DiffDatabaseMapping
method_name (str) – attribute of DiffDatabaseMapping to call for performing the operation
getter_name (str) – attribute of SpineDBManager to call for getting affected items
signal_name (str) – signal attribute of SpineDBManager to emit if successful
- _remove_items(self, db_map_typed_ids)[source]¶
Removes items from database.
- Parameters
db_map_typed_ids (dict) – lists of items to remove, keyed by item type (str), keyed by DiffDatabaseMapping
- export_to_sqlite(self, file_path, data_for_export, caller)[source]¶
Exports given data into SQLite file.
- export_to_json(self, file_path, data_for_export, caller)[source]¶
Exports given data into JSON file.
- export_to_excel(self, file_path, data_for_export, caller)[source]¶
Exports given data into Excel file.
- _refresh_scenario_alternatives(self, db_map_data)[source]¶
Refreshes cached scenarios when updating scenario alternatives.
- Parameters
db_map_data (dict) – lists of updated items keyed by DiffDatabaseMapping
- _refresh_parameter_definitions_by_tag(self, db_map_data)[source]¶
Refreshes cached parameter definitions when updating parameter tags.
- Parameters
db_map_data (dict) – lists of updated items keyed by DiffDatabaseMapping
- _cascade_refresh_relationship_classes(self, db_map_data)[source]¶
Refreshes cached relationship classes when updating object classes.
- Parameters
db_map_data (dict) – lists of updated items keyed by DiffDatabaseMapping
- _cascade_refresh_relationships_by_object(self, db_map_data)[source]¶
Refreshed cached relationships in cascade when updating objects.
- Parameters
db_map_data (dict) – lists of updated items keyed by DiffDatabaseMapping
- _cascade_refresh_parameter_definitions(self, db_map_data)[source]¶
Refreshes cached parameter definitions in cascade when updating entity classes.
- Parameters
db_map_data (dict) – lists of updated items keyed by DiffDatabaseMapping
- _cascade_refresh_parameter_definitions_by_value_list(self, db_map_data)[source]¶
Refreshes cached parameter definitions when updating parameter_value lists.
- Parameters
db_map_data (dict) – lists of updated items keyed by DiffDatabaseMapping
- _cascade_refresh_parameter_values_by_entity_class(self, db_map_data)[source]¶
Refreshes cached parameter values in cascade when updating entity classes.
- Parameters
db_map_data (dict) – lists of updated items keyed by DiffDatabaseMapping
- _cascade_refresh_parameter_values_by_entity(self, db_map_data)[source]¶
Refreshes cached parameter values in cascade when updating entities.
- Parameters
db_map_data (dict) – lists of updated items keyed by DiffDatabaseMapping
- _cascade_refresh_parameter_values_by_alternative(self, db_map_data)[source]¶
Refreshes cached parameter values in cascade when updating alternatives.
- Parameters
db_map_data (dict) – lists of updated items keyed by DiffDatabaseMapping
- _cascade_refresh_parameter_values_by_definition(self, db_map_data)[source]¶
Refreshes cached parameter values in cascade when updating parameter definitions.
- Parameters
db_map_data (dict) – lists of updated items keyed by DiffDatabaseMapping
- _cascade_refresh_parameter_definitions_by_tag(self, db_map_data)[source]¶
Refreshes cached parameter definitions when updating parameter tags.
- Parameters
db_map_data (dict) – lists of updated items keyed by DiffDatabaseMapping
- _cascade_refresh_features_by_paremeter_definition(self, db_map_data)[source]¶
Refreshes cached features in cascade when updating parameter definitions.
- Parameters
db_map_data (dict) – lists of updated items keyed by DiffDatabaseMapping
- _cascade_refresh_features_by_paremeter_value_list(self, db_map_data)[source]¶
Refreshes cached features in cascade when updating parameter value lists.
- Parameters
db_map_data (dict) – lists of updated items keyed by DiffDatabaseMapping