Skip to content

Commit

Permalink
Prevent error messages when starting GIMP
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilburda committed Aug 30, 2023
1 parent b507bca commit 2136f14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
13 changes: 5 additions & 8 deletions pdb-wrapper/pypdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
from gi.repository import Gimp


_gimp_pdb = Gimp.get_pdb()


class _PyPDB:

def __init__(self):
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion pdb-wrapper/pypdb.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 2136f14

Please sign in to comment.