From 7bfa6ea5028992ffd3fd1a6c6da8d7d5f4791eb0 Mon Sep 17 00:00:00 2001 From: notEvil Date: Mon, 19 Dec 2022 14:59:02 +0100 Subject: [PATCH] - gimpml/plugins: changed to be compatible with Gimp 2.99.14 --- gimpml/plugins/canny/canny.py | 8 ++++---- gimpml/plugins/coloring/coloring.py | 10 +++++----- gimpml/plugins/colorpalette/colorpalette.py | 8 ++++---- gimpml/plugins/deblur/deblur.py | 8 ++++---- gimpml/plugins/dehaze/dehaze.py | 8 ++++---- gimpml/plugins/denoise/denoise.py | 8 ++++---- gimpml/plugins/detectobjects/detectobjects.py | 8 ++++---- gimpml/plugins/enlighten/enlighten.py | 8 ++++---- gimpml/plugins/faceparse/faceparse.py | 8 ++++---- gimpml/plugins/filterfolder/filterfolder.py | 6 +++--- gimpml/plugins/inpainting/inpainting.py | 8 ++++---- gimpml/plugins/interpolation/interpolation.py | 6 +++--- gimpml/plugins/kmeans/kmeans.py | 8 ++++---- gimpml/plugins/matting/matting.py | 8 ++++---- gimpml/plugins/monodepth/monodepth.py | 8 ++++---- gimpml/plugins/semseg/semseg.py | 8 ++++---- gimpml/plugins/superresolution/superresolution.py | 10 +++++----- 17 files changed, 68 insertions(+), 68 deletions(-) diff --git a/gimpml/plugins/canny/canny.py b/gimpml/plugins/canny/canny.py index 461261f..590e266 100644 --- a/gimpml/plugins/canny/canny.py +++ b/gimpml/plugins/canny/canny.py @@ -78,7 +78,7 @@ def canny( Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image) copy.set_name("Canny Edge") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -235,11 +235,11 @@ class Canny(Gimp.PlugIn): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["canny"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "canny": diff --git a/gimpml/plugins/coloring/coloring.py b/gimpml/plugins/coloring/coloring.py index 625ff05..56bc79c 100644 --- a/gimpml/plugins/coloring/coloring.py +++ b/gimpml/plugins/coloring/coloring.py @@ -77,7 +77,7 @@ def coloring(procedure, image, n_drawables, drawables, force_cpu, progress_bar, Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image) copy.set_name("Coloring") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -222,7 +222,7 @@ def run(procedure, run_mode, image, n_drawables, layer, args, data): Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(image_paths["colorpalette"]), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image_new) copy.set_name("Color Palette") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -250,11 +250,11 @@ class Coloring(Gimp.PlugIn): # GimpPlugIn virtual methods # def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["coloring"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "coloring": diff --git a/gimpml/plugins/colorpalette/colorpalette.py b/gimpml/plugins/colorpalette/colorpalette.py index 5ae6e2d..fbfe521 100644 --- a/gimpml/plugins/colorpalette/colorpalette.py +++ b/gimpml/plugins/colorpalette/colorpalette.py @@ -31,7 +31,7 @@ def colorpalette(procedure, run_mode, image, n_drawables, drawable, args, data): ) ), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image_new) copy.set_name("Color Palette") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -44,11 +44,11 @@ class ColorPalette(Gimp.PlugIn): __gproperties__ = {} def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["colorpalette"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = Gimp.ImageProcedure.new( self, name, Gimp.PDBProcType.PLUGIN, colorpalette, None diff --git a/gimpml/plugins/deblur/deblur.py b/gimpml/plugins/deblur/deblur.py index 07ceac6..cf94711 100644 --- a/gimpml/plugins/deblur/deblur.py +++ b/gimpml/plugins/deblur/deblur.py @@ -70,7 +70,7 @@ def deblur(procedure, image, drawable, force_cpu, progress_bar, config_path_outp Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image) copy.set_name("Deblur") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -202,11 +202,11 @@ class Deblur(Gimp.PlugIn): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["deblur"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "deblur": diff --git a/gimpml/plugins/dehaze/dehaze.py b/gimpml/plugins/dehaze/dehaze.py index a953e7e..39ff26b 100644 --- a/gimpml/plugins/dehaze/dehaze.py +++ b/gimpml/plugins/dehaze/dehaze.py @@ -70,7 +70,7 @@ def dehaze(procedure, image, drawable, force_cpu, progress_bar, config_path_outp Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image) copy.set_name("Dehaze") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -201,11 +201,11 @@ class Dehaze(Gimp.PlugIn): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["dehaze"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "dehaze": diff --git a/gimpml/plugins/denoise/denoise.py b/gimpml/plugins/denoise/denoise.py index 3d4ce4f..f52875e 100644 --- a/gimpml/plugins/denoise/denoise.py +++ b/gimpml/plugins/denoise/denoise.py @@ -68,7 +68,7 @@ def denoise(procedure, image, drawable, force_cpu, progress_bar, config_path_out Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image) copy.set_name("Denoise") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -199,11 +199,11 @@ class Denoise(Gimp.PlugIn): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["denoise"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "denoise": diff --git a/gimpml/plugins/detectobjects/detectobjects.py b/gimpml/plugins/detectobjects/detectobjects.py index 30a7a11..ac9dedb 100644 --- a/gimpml/plugins/detectobjects/detectobjects.py +++ b/gimpml/plugins/detectobjects/detectobjects.py @@ -62,7 +62,7 @@ def detectobjects(procedure, image, drawable, force_cpu, progress_bar, config_pa Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image) copy.set_name("Objects detected.") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -193,11 +193,11 @@ class DetectObjects(Gimp.PlugIn): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["detectobjects"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "detectobjects": diff --git a/gimpml/plugins/enlighten/enlighten.py b/gimpml/plugins/enlighten/enlighten.py index 9dcb4df..5ae9d0e 100644 --- a/gimpml/plugins/enlighten/enlighten.py +++ b/gimpml/plugins/enlighten/enlighten.py @@ -69,7 +69,7 @@ def enlighten(procedure, image, drawable, force_cpu, progress_bar, config_path_o Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image) copy.set_name("Enlightened") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -200,11 +200,11 @@ class Enlighten(Gimp.PlugIn): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["enlighten"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "enlighten": diff --git a/gimpml/plugins/faceparse/faceparse.py b/gimpml/plugins/faceparse/faceparse.py index f9df6a9..81b9deb 100644 --- a/gimpml/plugins/faceparse/faceparse.py +++ b/gimpml/plugins/faceparse/faceparse.py @@ -69,7 +69,7 @@ def faceparse(procedure, image, drawable, force_cpu, progress_bar, config_path_o Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image) copy.set_name("Face Parse") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -201,11 +201,11 @@ class FaceParse(Gimp.PlugIn): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["faceparse"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "faceparse": diff --git a/gimpml/plugins/filterfolder/filterfolder.py b/gimpml/plugins/filterfolder/filterfolder.py index 4bd2d20..41d3330 100644 --- a/gimpml/plugins/filterfolder/filterfolder.py +++ b/gimpml/plugins/filterfolder/filterfolder.py @@ -218,11 +218,11 @@ def run_mode(self, runmode): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["filterfolder"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "filterfolder": diff --git a/gimpml/plugins/inpainting/inpainting.py b/gimpml/plugins/inpainting/inpainting.py index 01bb741..317eeca 100644 --- a/gimpml/plugins/inpainting/inpainting.py +++ b/gimpml/plugins/inpainting/inpainting.py @@ -127,7 +127,7 @@ def inpainting( Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image) copy.set_name("In Painting") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -305,11 +305,11 @@ class InPainting(Gimp.PlugIn): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["inpainting"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "inpainting": diff --git a/gimpml/plugins/interpolation/interpolation.py b/gimpml/plugins/interpolation/interpolation.py index 4cc3e25..3789795 100644 --- a/gimpml/plugins/interpolation/interpolation.py +++ b/gimpml/plugins/interpolation/interpolation.py @@ -276,11 +276,11 @@ class Interpolation(Gimp.PlugIn): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["interpolation"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "interpolation": diff --git a/gimpml/plugins/kmeans/kmeans.py b/gimpml/plugins/kmeans/kmeans.py index 6d96da6..56d41d9 100644 --- a/gimpml/plugins/kmeans/kmeans.py +++ b/gimpml/plugins/kmeans/kmeans.py @@ -77,7 +77,7 @@ def k_means( Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image) copy.set_name("K Means") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -232,11 +232,11 @@ class Kmeans(Gimp.PlugIn): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["kmeans"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "kmeans": diff --git a/gimpml/plugins/matting/matting.py b/gimpml/plugins/matting/matting.py index 2f93141..0b3e42a 100644 --- a/gimpml/plugins/matting/matting.py +++ b/gimpml/plugins/matting/matting.py @@ -73,7 +73,7 @@ def matting( Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image) copy.set_name("Matting") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -220,11 +220,11 @@ class Matting(Gimp.PlugIn): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["matting"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "matting": diff --git a/gimpml/plugins/monodepth/monodepth.py b/gimpml/plugins/monodepth/monodepth.py index d664030..aa3aa94 100644 --- a/gimpml/plugins/monodepth/monodepth.py +++ b/gimpml/plugins/monodepth/monodepth.py @@ -69,7 +69,7 @@ def monodepth(procedure, image, drawable, force_cpu, progress_bar, config_path_o Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image) copy.set_name("Mono Depth") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -201,11 +201,11 @@ class MonoDepth(Gimp.PlugIn): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["monodepth"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "monodepth": diff --git a/gimpml/plugins/semseg/semseg.py b/gimpml/plugins/semseg/semseg.py index e73a121..aea8ca0 100644 --- a/gimpml/plugins/semseg/semseg.py +++ b/gimpml/plugins/semseg/semseg.py @@ -67,7 +67,7 @@ def semseg(procedure, image, drawable, force_cpu, progress_bar, config_path_outp Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image) copy.set_name("Semantic Segmentation") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -200,11 +200,11 @@ class SemSeg(Gimp.PlugIn): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["semseg"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "semseg": diff --git a/gimpml/plugins/superresolution/superresolution.py b/gimpml/plugins/superresolution/superresolution.py index 45af792..0d62e5f 100644 --- a/gimpml/plugins/superresolution/superresolution.py +++ b/gimpml/plugins/superresolution/superresolution.py @@ -85,7 +85,7 @@ def super_resolution( Gimp.RunMode.NONINTERACTIVE, Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image) copy.set_name("Super-resolution") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -99,7 +99,7 @@ def super_resolution( Gimp.RunMode.NONINTERACTIVE, Gio.File.new_for_path(os.path.join(weight_path, "..", "cache.png")), ) - result_layer = result.get_active_layer() + result_layer = result.list_layers()[0] copy = Gimp.Layer.new_from_drawable(result_layer, image_new) copy.set_name("Super-resolution") copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY @@ -280,11 +280,11 @@ class SuperResolution(Gimp.PlugIn): ## GimpPlugIn virtual methods ## def do_query_procedures(self): - self.set_translation_domain( - "gimp30-python", Gio.file_new_for_path(Gimp.locale_directory()) - ) return ["superresolution"] + def do_set_i18n(self, procname): + return True, "gimp30-python", None + def do_create_procedure(self, name): procedure = None if name == "superresolution":