diff --git a/pdb-wrapper/pypdb.py b/pdb-wrapper/pypdb.py index 02dc6c5..594f633 100644 --- a/pdb-wrapper/pypdb.py +++ b/pdb-wrapper/pypdb.py @@ -5,9 +5,6 @@ from gi.repository import Gimp -_gimp_pdb = Gimp.get_pdb() - - class _PyPDB: def __init__(self): @@ -53,7 +50,7 @@ def _get_proc_by_name(self, proc_name): @staticmethod def _procedure_exists(proc_name): - return _gimp_pdb.procedure_exists(proc_name) + return Gimp.get_pdb().procedure_exists(proc_name) class PyPDBProcedure: @@ -62,7 +59,7 @@ def __init__(self, pdb_wrapper, proc_name): self._pdb_wrapper = pdb_wrapper self._name = proc_name - self._info = _gimp_pdb.lookup_procedure(self._name) + self._info = Gimp.get_pdb().lookup_procedure(self._name) self._has_run_mode = self._get_has_run_mode() @property @@ -89,11 +86,11 @@ def __call__( config: Optional[Gimp.ProcedureConfig] = None): if config is None: if self._has_run_mode: - result = _gimp_pdb.run_procedure(self._name, [run_mode, *args]) + result = Gimp.get_pdb().run_procedure(self._name, [run_mode, *args]) else: - result = _gimp_pdb.run_procedure(self._name, args) + result = Gimp.get_pdb().run_procedure(self._name, args) else: - result = _gimp_pdb.run_procedure_config(self._name, config) + result = Gimp.get_pdb().run_procedure_config(self._name, config) if result is None: return None diff --git a/pdb-wrapper/pypdb.pyi b/pdb-wrapper/pypdb.pyi index 56fe2ff..f91d527 100644 --- a/pdb-wrapper/pypdb.pyi +++ b/pdb-wrapper/pypdb.pyi @@ -7,7 +7,6 @@ from typing import Optional import gi gi.require_version('Gimp', '3.0') from gi.repository import Gimp -_gimp_pdb = Gimp.get_pdb() class _PyPDB: