python.external_config.config.config_base module¶
-
class
ExternalConfiguration
(parent, bg_task_manager, plugin_id, engine_name, interpreter, software_hash, pipeline_config_uri, status=1)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Object wrapping an external pipeline configuration.
Signals
Signal commands_loaded(project_id, config, commands): Gets emitted after request_commands()
has been called and once commands have been loaded for the configuration. The commands parameter contains a list ofExternalCommand
instances.Signal commands_load_failed(project_id, config, reason): Gets emitted after request_commands()
has been called if command loading fails for some reason. The reason string parameter contains a message signfiying why the load failed.-
CONFIGURATION_INACCESSIBLE
= 2¶
-
CONFIGURATION_READY
= 1¶
-
TASK_GROUP
= 'tk-framework-shotgunutils.external_config.ExternalConfiguration'¶
-
commands_load_failed
¶ Used by autodoc_mock_imports.
-
commands_loaded
¶ Used by autodoc_mock_imports.
-
descriptor_uri
¶ The descriptor URI associated with this pipeline configuration.
-
engine_name
¶ The engine name associated with the configuration.
-
interpreter
¶ The Python interpreter to use when accessing this configuration
-
is_primary
¶ Returns
True
if this is the primary configuration,False
if not.
-
is_valid
¶ Returns
True
if this configuration contains valid data that can be used in the current environment, andFalse
if the configuration is inaccessible for some reason.
-
pipeline_configuration_id
¶ The associated pipeline configuration id or
None
if not defined.
-
pipeline_configuration_name
¶ The name of the associated pipeline configuration or
None
if not defined.
-
plugin_id
¶ The plugin id associated with the configuration.
-
request_commands
(project_id, entity_type, entity_id, link_entity_type, engine_fallback=None)[source]¶ Request commands for the given shotgun entity.
A
commands_loaded
signal will be emitted once the commands are available.Parameters: - project_id (int) – Associated project id
- entity_type (str) – Associated entity type
- entity_id (int) – Associated entity id. If this is set to None, a best guess for a generic listing will be carried out.
- link_entity_type (str) – Entity type that the item is linked to. This is typically provided for things such as task, versions or notes, where having different values it per linked type can be beneficial.
- engine_fallback (str) – If the main engine isn’t available for the given entity id and project, request generate commands for the fallback engine specified. This can be useful in backwards compatibility scenarios.
Raises: RuntimeError if this configuration’s status does not allow for commands requests.
-
software_hash
¶ A hash of the state of the software entity associated with this configuration.
-
status
¶ The current status of the configuration. This will be returned as an enum value provided by
ExternalConfiguration
.
-
tracking_latest
¶ Returns True if this configuration is tracking an external ‘latest version’. This means that we cannot rely on any caches - because a remote process may release a new “latest” version, we cannot know simply by computing a cache key or looking at a local state on disk whether a cached configuration is up to date or not. The only way to determine this is by actually fully resolve the configuration.
Note
External configurations with this property returning True will have their commands memoized; The first call to
request_commands()
will resolve the associated commands and subsequent requests will simply return that result. In order do perform a new evaluation of the list of associated commands, instantiate a new External Configuration instance.
-