spinetoolbox.project_item.logging_connection
Contains logging connection and jump classes.
Module Contents
Classes
A project item connection that is compatible with headless mode. |
|
A project item connection that is compatible with headless mode. |
|
Represents a conditional jump between two project items. |
Attributes
- class spinetoolbox.project_item.logging_connection.HeadlessConnection(source_name, source_position, destination_name, destination_position, options=None, filter_settings=None, legacy_resource_filter_ids=None)[source]
Bases:
spine_engine.project_item.connection.ResourceConvertingConnection
A project item connection that is compatible with headless mode.
- Parameters
source_name (str) – source project item’s name
source_position (str) – source anchor’s position
destination_name (str) – destination project item’s name
destination_position (str) – destination anchor’s position
options (dict, optional) – any additional options
filter_settings (FilterSettings, optional) – filter settings
- set_filter_enabled(resource_label, filter_type, filter_name, enabled)[source]
Enables or disables a filter.
- Parameters
resource_label (str) – database resource name
filter_type (str) – filter type
filter_name (str) – filter name
enabled (bool) – True to enable the filter, False to disable it
- set_filter_type_enabled(filter_type, enabled)[source]
Enables or disables a filter type.
- Parameters
filter_type (str) – filter type
enabled (bool) – True to enable the filter type, False to disable it
- _convert_legacy_resource_filter_ids_to_filter_settings()[source]
Converts legacy resource filter ids to filter settings.
This method should be called once after constructing the connection from potentially legacy dict using
from_dict()
.
- class spinetoolbox.project_item.logging_connection.LoggingConnection(*args, toolbox, **kwargs)[source]
Bases:
spinetoolbox.log_mixin.LogMixin
,HeadlessConnection
A project item connection that is compatible with headless mode.
- Parameters
source_name (str) – source project item’s name
source_position (str) – source anchor’s position
destination_name (str) – destination project item’s name
destination_position (str) – destination anchor’s position
options (dict, optional) – any additional options
filter_settings (FilterSettings, optional) – filter settings
- has_filters()[source]
Returns True if connection has any filters.
- Returns
True if connection has filters, False otherwise
- Return type
bool
- _pop_unused_db_maps()[source]
Removes unused database maps and unregisters from listening the DB manager.
- may_have_filters()[source]
Returns whether this connection may have filters.
- Returns
True if it is possible for the connection to have filters, False otherwise
- Return type
bool
- may_have_write_index()[source]
Returns whether this connection may have write index.
- Returns
True if it is possible for the connection to have write index, False otherwise
- Return type
bool
- may_use_memory_db()[source]
Returns whether this connection may use memory DB.
- Returns
True if it is possible for the connection to use memory DB, False otherwise
- Return type
bool
- may_use_datapackage()[source]
Returns whether this connection may use datapackage.
- Returns
True if it is possible for the connection to use datapackage, False otherwise
- Return type
bool
- may_purge_before_writing()[source]
Returns whether this connection may purge before writing.
- Returns
True if it is possible for the connection to purge before writing, False otherwise
- Return type
bool
- online_filters(resource_label, filter_type)[source]
Returns filter online states for given resource and filter type.
- Parameters
resource_label (str) – resource label
filter_type (str) – filter type
- Returns
mapping from filter names to online states
- Return type
dict
- set_online(resource, filter_type, online)[source]
Sets the given filters online or offline.
- Parameters
resource (str) – Resource label
filter_type (str) – filter type
online (dict) – mapping from scenario name to online flag
- set_filter_default_online_status(auto_online)[source]
Sets the auto_online flag.
- Parameters
auto_online (bool) – If True, unknown filters are online by default
- refresh_resource_filter_model()[source]
Makes resource filter mode fetch filter data from database.
- set_connection_options(options)[source]
Overwrites connections options.
- Parameters
options (dict) – new options
- class spinetoolbox.project_item.logging_connection.LoggingJump(*args, toolbox=None, **kwargs)[source]
Bases:
spinetoolbox.log_mixin.LogMixin
,spine_engine.project_item.connection.Jump
Represents a conditional jump between two project items.
- Parameters
source_name (str) – source project item’s name
source_position (str) – source anchor’s position
destination_name (str) – destination project item’s name
destination_position (str) – destination anchor’s position
condition (dict) – jump condition