spinetoolbox.project_items.importer.executable_item

Contains Importer’s executable item as well as support utilities.

authors:
  1. Soininen (VTT)
date:

1.4.2020

Module Contents

Classes

ExecutableItem The part of a project item that is executed by the Spine Engine.

Functions

_files_from_resources(resources) Returns a list of files available in given resources.
class spinetoolbox.project_items.importer.executable_item.ExecutableItem(name, settings, logs_dir, gams_path, cancel_on_error, logger)[source]

Bases: spinetoolbox.executable_item_base.ExecutableItemBase, PySide2.QtCore.QObject

The part of a project item that is executed by the Spine Engine.

Parameters:
  • name (str) – Importer’s name
  • settings (dict) – import mappings
  • logs_dir (str) – path to the directory where logs should be stored
  • gams_path (str) – path to system’s GAMS executable or empty string for the default path
  • cancel_on_error (bool) – if True, revert changes on error and quit
  • logger (LoggerInterface) – a logger
importing_finished[source]

Emitted after import thread has finished.

static item_type()[source]

Returns ImporterExecutable’s type identifier string.

stop_execution(self)[source]

Stops execution.

_execute_backward(self, resources)[source]

See base class.

_execute_forward(self, resources)[source]

See base class.

_handle_worker_finished(self, exit_code)[source]
_destroy_current_worker(self)[source]

Runs before starting execution and after worker finishes. Destroys current worker and quits thread if present.

_gams_system_directory(self)[source]

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

classmethod from_dict(cls, item_dict, name, project_dir, app_settings, specifications, logger)[source]

See base class.

spinetoolbox.project_items.importer.executable_item._files_from_resources(resources)[source]

Returns a list of files available in given resources.