App Interface

class app.MultiPublish2[source]

This is the sgtk.platform.Application subclass that defines the top-level publish2 interface.

Application instances are constructed by the toolkit launch process and various factory methods such as start_engine().

Parameters:
  • engine – The engine instance to connect this app to

  • app_name – The short name of this app (e.g. tk-nukepublish)

  • settings – a settings dictionary for this app

property base_hooks

Exposes the publish2 base_hooks module.

This module provides base class implementations of collector and publish plugin hooks:

Access to these classes won’t typically be needed when writing hooks as they are are injected into the class hierarchy automatically for any collector or publish plugins configured.

Returns:

A handle on the app’s base_hooks module.

property util

Exposes the publish2 util module.

This module provides methods that are useful to collector and publish plugin hooks. Example code running in a hook:

# get a handle on the publish2 app
app = self.parent

# call a util method
path_components = app.util.get_file_path_components(path)

Some of the methods available via util are the path_info hook methods. Exposing them via this property allows them to be called directly.

Returns:

A handle on the app’s util module.

create_publish_manager(publish_logger=None)[source]

Create and return a tk_multi_publish2.PublishManager instance. See the tk_multi_publish2.PublishManager docs for details on how it can be used to automate your publishing workflows.

Parameters:

publish_logger – This is a standard python logger to use during publishing. A default logger will be provided if not supplied. This can be useful when implementing a custom UI, for example, with a specialized log handler (as is the case with the Publisher)

Returns:

A tk_multi_publish2.PublishManager instance