Skip to content

ApplicationHandler

src.utils.adobe.ApplicationHandler

Bases: Application

Wrapper for the Photoshop Application class.

Source code in src\utils\adobe.py
class ApplicationHandler(Application):
    """Wrapper for the Photoshop Application class."""

    def __init__(self, env: Optional[AppEnvironment] = None):
        version = env.PS_VERSION if env else None
        super().__init__(version=version)
        self._env = env

        # Set error dialog state
        with suppress(Exception):
            self.displayDialogs = DialogModes.DisplayErrorDialogs if (
                env.PS_ERROR_DIALOG
            ) else DialogModes.DisplayNoDialogs

    """
    * Handler Properties
    """

    @cached_property
    def _env(self) -> Optional[AppEnvironment]:
        """AppEnvironment: Global app environment object."""
        return

    def is_error_dialog_enabled(self) -> bool:
        """bool: Whether to allow error dialogs, defined in app environment object."""
        if self._env:
            return self._env.PS_ERROR_DIALOG
        return False

Functions

is_error_dialog_enabled() -> bool

Source code in src\utils\adobe.py
def is_error_dialog_enabled(self) -> bool:
    """bool: Whether to allow error dialogs, defined in app environment object."""
    if self._env:
        return self._env.PS_ERROR_DIALOG
    return False