spinetoolbox.project_items.exporter.exporter
¶
Exporter project item.
author: |
|
---|---|
date: | 5.9.2019 |
Module Contents¶
-
class
spinetoolbox.project_items.exporter.exporter.
Exporter
(name, description, settings_packs, x, y, toolbox, project, logger)[source]¶ Bases:
spinetoolbox.project_item.ProjectItem
This project item handles all functionality regarding exporting a database to a file.
Currently, only .gdx format is supported.
Parameters: - name (str) – item name
- description (str) – item description
- settings_packs (list) – dicts mapping database URLs to _SettingsPack objects
- x (float) – initial X coordinate of item icon
- y (float) – initial Y coordinate of item icon
- toolbox (ToolboxUI) – a ToolboxUI instance
- project (SpineToolboxProject) – the project this item belongs to
- logger (LoggerInterface) – a logger instance
-
make_signal_handler_dict
(self)[source]¶ Returns a dictionary of all shared signals and their handlers.
-
_start_worker
(self, database_url, update_settings=False)[source]¶ Starts fetching settings using a worker in another thread.
-
_update_export_settings
(self, database_url, settings)[source]¶ Sets new settings for given database.
-
_update_indexing_settings
(self, database_url, indexing_settings)[source]¶ Sets new indexing settings for given database.
-
_update_indexing_domains
(self, database_url, domains)[source]¶ Sets new indexing domains for given database.
-
_update_merging_settings
(self, database_url, settings)[source]¶ Sets new merging settings for given database.
-
_update_merging_domains
(self, database_url, domains)[source]¶ Sets new merging domains for given database.
-
_worker_finished
(self, database_url)[source]¶ Cleans up after a worker has finished fetching export settings.
-
_worker_failed
(self, database_url, exception)[source]¶ Clean up after a worker has failed fetching export settings.
-
_check_state
(self, clear_before_check=True)[source]¶ Checks the status of database export settings.
Updates both the notification message (exclamation icon) and settings states.
-
_reset_settings_window
(self, database_url)[source]¶ Sends new settings to Gdx Export Settings window.
-
_update_out_file_name
(self, file_name, database_path)[source]¶ Pushes a new UpdateExporterOutFileNameCommand to the toolbox undo stack.
-
_update_settings_from_settings_window
(self, database_path)[source]¶ Pushes a new UpdateExporterSettingsCommand to the toolbox undo stack.
-
undo_redo_out_file_name
(self, file_name, database_path)[source]¶ Updates the output file name for given database
-
undo_or_redo_settings
(self, settings, indexing_settings, indexing_domains, merging_settings, merging_domains, database_path)[source]¶ Updates the export settings for given database.
-
_discard_settings_window
(self, database_path)[source]¶ Discards the settings window for given database.
-
_send_settings_to_window
(self, database_url)[source]¶ Resets settings in given export settings window.
-
_resolve_gams_system_directory
(self)[source]¶ Returns GAMS system path from Toolbox settings or None if GAMS default is to be used.
-
class
spinetoolbox.project_items.exporter.exporter.
SettingsPack
(output_file_name)[source]¶ Bases:
PySide2.QtCore.QObject
Keeper of all settings and stuff needed for exporting a database.
-
output_file_name
¶ name of the export file
Type: str
-
indexing_settings
¶ parameter indexing settings
Type: dict
-
indexing_domains
¶ extra domains needed for parameter indexing
Type: list
-
merging_settings
¶ parameter merging settings
Type: dict
-
merging_domains
¶ extra domains needed for parameter merging
Type: list
-
settings_window
¶ settings editor window
Type: GdxExportSettings
Parameters: output_file_name (str) – name of the export file -
-
class
spinetoolbox.project_items.exporter.exporter.
_Notifications
[source]¶ Bases:
PySide2.QtCore.QObject
Holds flags for different error conditions.
-
duplicate_output_file_name
¶ if True there are duplicate output file names
Type: bool
-
missing_output_file_name
¶ if True the output file name is missing
Type: bool
-
missing_parameter_indexing
¶ if True there are indexed parameters without indexing domains
Type: bool
-
erroneous_database
¶ if True the database has issues
Type: bool
-
changed_due_to_settings_state
[source]¶ Emitted when notifications have changed due to changes in settings state.
-
__ior__
(self, other)[source]¶ ORs the flags with another notifications.
Parameters: other (_Notifications) – a _Notifications object
-