Gimp.BatchProcedure

g GObject.Object GObject.Object Gimp.Procedure Gimp.Procedure GObject.Object->Gimp.Procedure Gimp.BatchProcedure Gimp.BatchProcedure Gimp.Procedure->Gimp.BatchProcedure

Subclasses:

None

Methods

Inherited:

Gimp.Procedure (145), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (plug_in, name, interpreter_name, proc_type, run_func, *run_data)

get_interpreter_name ()

set_interpreter_name (interpreter_name)

Virtual Methods

Inherited:

Gimp.Procedure (4), GObject.Object (7)

Properties

Inherited:

Gimp.Procedure (3)

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gimp.BatchProcedure(**kwargs)
Bases:

Gimp.Procedure

Abstract:

No

Structure:

Gimp.BatchProcedureClass

Batch procedures implement an interpreter able to run commands as input.

In particular, batch procedures will be available on the command line through the --batch-interpreter option to switch the chosen interpreter. Then any command given through the --batch option will have to be in the chosen language.

It makes GIMP usable on the command line, but also to process small scripts (without making full-featured plug-ins), fully in command line without graphical interface.

classmethod new(plug_in, name, interpreter_name, proc_type, run_func, *run_data)
Parameters:
Returns:

a new Gimp.Procedure.

Return type:

Gimp.Procedure

Creates a new batch interpreter procedure named name which will call run_func when invoked.

See Gimp.Procedure.new() for information about proc_type.

Gimp.BatchProcedure is a Gimp.Procedure subclass that makes it easier to write batch interpreter procedures.

It automatically adds the standard

(Gimp.RunMode, str)

arguments of a batch procedure. It is possible to add additional arguments.

When invoked via Gimp.Procedure.run(), it unpacks these standard arguments and calls run_func which is a Gimp.BatchFunc. The “args” Gimp.ValueArray of #GimpRunSaveFunc only contains additionally added arguments.

New in version 3.0.

get_interpreter_name()
Returns:

The procedure’s interpreter name.

Return type:

str

Returns the procedure’s interpreter name, as set with [method`BatchProcedure`.set_interpreter_name].

New in version 3.0.

set_interpreter_name(interpreter_name)
Parameters:

interpreter_name (str) – A public-facing name for the interpreter, e.g. “Python 3”.

Associates an interpreter name with a batch procedure.

This name can be used for any public-facing strings, such as graphical interface labels or command line usage. E.g. the command line interface could list all available interface, displaying both a procedure name and a “pretty printing” title.

Note that since the format name is public-facing, it is recommended to localize it at runtime, for instance through gettext, like:

``c gimp_batch_procedure_set_interpreter_name (procedure, _(“Python 3”)); ``

Some language would indeed localize even some technical terms or acronyms, even if sometimes just to rewrite them with the local writing system.

New in version 3.0.