Skip to content

ShotgridInstance

ShotgridInstance

ShotgridInstance(plugin: FPTPlugin)

Context manager for handling a Shotgun API session.

This helper class is designed to manage the lifecycle of a Shotgun API instance within a with-statement. It ensures the connection is properly closed after use.

Parameters:

  • plugin

    (ShotgridPlugin) –

    Instance of the Shotgrid plugin.

Methods:

  • __enter__

    Instantiate and return a Shotgun API instance.

  • __exit__

    Clean up the Shotgun API instance.

__enter__

__enter__() -> Shotgun

Instantiate and return a Shotgun API instance.

Returns:

  • Shotgun ( Shotgun ) –

    Shotgun API instance.

__exit__

__exit__(exc_type: Optional[type], exc_value: Optional[BaseException], exc_tb: Optional[object]) -> None

Clean up the Shotgun API instance.