spinetoolbox.project_items.exporter

Exporter project item plugin.

author:
  1. Soininen (VTT)
date:

25.9.2019

Package Contents

class spinetoolbox.project_items.exporter.item_maker(name, description, settings_packs, x, y, toolbox, project, logger)

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
set_up(self)

See base class.

static item_type()

See base class.

static category()

See base class.

settings_pack(self, database_path)
make_signal_handler_dict(self)

Returns a dictionary of all shared signals and their handlers.

restore_selections(self)

Restores selections and connects signals.

_connect_signals(self)
_update_properties_tab(self)

Updates the database list in the properties tab.

execute_forward(self, resources)

See base class.

_do_handle_dag_changed(self, resources)

See base class.

_start_worker(self, database_url, update_settings=False)

Starts fetching settings using a worker in another thread.

_update_export_settings(self, database_url, settings)

Sets new settings for given database.

_update_indexing_settings(self, database_url, indexing_settings)

Sets new indexing settings for given database.

_update_indexing_domains(self, database_url, domains)

Sets new indexing domains for given database.

_update_merging_settings(self, database_url, settings)

Sets new merging settings for given database.

_update_merging_domains(self, database_url, domains)

Sets new merging domains for given database.

_worker_finished(self, database_url)

Cleans up after a worker has finished fetching export settings.

_worker_failed(self, database_url, exception)

Clean up after a worker has failed fetching export settings.

_check_state(self, clear_before_check=True)

Checks the status of database export settings.

Updates both the notification message (exclamation icon) and settings states.

_check_missing_file_names(self)

Checks the status of output file names.

_check_duplicate_file_names(self)

Checks for duplicate output file names.

_check_missing_parameter_indexing(self)

Checks the status of parameter indexing settings.

_check_erroneous_databases(self)

Checks errors in settings fetching from a database.

_report_notifications(self)

Updates the exclamation icon and notifications labels.

_show_settings(self, database_url)

Opens the item’s settings window.

_reset_settings_window(self, database_url)

Sends new settings to Gdx Export Settings window.

_dispose_settings_window(self, database_url)

Deletes rejected export settings windows.

_update_out_file_name(self, file_name, database_path)

Pushes a new UpdateExporterOutFileNameCommand to the toolbox undo stack.

_update_settings_from_settings_window(self, database_path)

Pushes a new UpdateExporterSettingsCommand to the toolbox undo stack.

undo_redo_out_file_name(self, file_name, database_path)

Updates the output file name for given database

undo_or_redo_settings(self, settings, indexing_settings, indexing_domains, merging_settings, merging_domains, database_path)

Updates the export settings for given database.

item_dict(self)

Returns a dictionary corresponding to this item’s configuration.

_discard_settings_window(self, database_path)

Discards the settings window for given database.

_send_settings_to_window(self, database_url)

Resets settings in given export settings window.

update_name_label(self)

See base class.

_resolve_gams_system_directory(self)

Returns GAMS system path from Toolbox settings or None if GAMS default is to be used.

notify_destination(self, source_item)

See base class.

_update_settings_after_db_commit(self, committed_db_maps)

Refreshes export settings for databases after data has been committed to them.

static default_name_prefix()

See base class.

output_resources_forward(self)

See base class.

tear_down(self)

See base class.

class spinetoolbox.project_items.exporter.icon_maker(toolbox, x, y, w, h, name)

Bases: spinetoolbox.graphics_items.ProjectItemIcon

Exporter icon for the Design View.

Parameters:
  • toolbox (ToolBoxUI) – QMainWindow instance
  • x (float) – Icon x coordinate
  • y (float) – Icon y coordinate
  • w (float) – Width of master icon
  • h (float) – Height of master icon
  • name (str) – Item name
class spinetoolbox.project_items.exporter.add_form_maker(toolbox, x, y)

Bases: spinetoolbox.widgets.add_project_item_widget.AddProjectItemWidget

A widget to query user’s preferences for a new item.

Parameters:
  • toolbox (ToolboxUI) – Parent widget
  • x (int) – X coordinate of new item
  • y (int) – Y coordinate of new item
call_add_item(self)

Creates new Item according to user’s selections.

class spinetoolbox.project_items.exporter.properties_widget_maker(toolbox)

Bases: PySide2.QtWidgets.QWidget

A main window widget to show Gdx Export item’s properties.

Parameters:toolbox (ToolboxUI) – a main window instance
ui

The UI form of this widget.

spinetoolbox.project_items.exporter.item_rank = 5[source]
spinetoolbox.project_items.exporter.item_category[source]
spinetoolbox.project_items.exporter.item_type[source]
spinetoolbox.project_items.exporter.item_icon = :/icons/project_item_icons/database-export.svg[source]