Gimp.BatchProcedure¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gimp.BatchProcedure(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
plug_in (
Gimp.PlugIn
) – aGimp.PlugIn
.name (
str
) – the new procedure’s name.interpreter_name (
str
) – the public-facing name, e.g. “Python 3”.proc_type (
Gimp.PDBProcType
) – the new procedure’sGimp.PDBProcType
.run_func (
Gimp.BatchFunc
) – the run function for the new procedure.
- Returns:
a new
Gimp.Procedure
.- Return type:
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 aGimp.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 aGimp.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:
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.