Gimp.FileProcedure

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

Subclasses:

Gimp.ExportProcedure, Gimp.LoadProcedure

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

get_extensions ()

get_format_name ()

get_handles_remote ()

get_magics ()

get_mime_types ()

get_prefixes ()

get_priority ()

set_extensions (extensions)

set_format_name (format_name)

set_handles_remote (handles_remote)

set_magics (magics)

set_mime_types (mime_types)

set_prefixes (prefixes)

set_priority (priority)

Virtual Methods

Inherited:

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

Properties

Inherited:

Gimp.Procedure (3)

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Gimp.Procedure

r

Class Details

class Gimp.FileProcedure(**kwargs)
Bases:

Gimp.Procedure

Abstract:

Yes

Structure:

Gimp.FileProcedureClass

File procedures implement file support. They cannot be created directly. Instead, you will create an instance of one of the sublasses (such as export or load procedures). This provides a common interface for file-related functions on these objects.

get_extensions()
Returns:

The procedure’s registered extensions.

Return type:

str

Returns the procedure’s extensions as set with [method`FileProcedure`.set_extensions].

New in version 3.0.

get_format_name()
Returns:

The procedure’s format name.

Return type:

str

Returns the procedure’s format name, as set with [method`FileProcedure`.set_format_name].

New in version 3.0.

get_handles_remote()
Returns:

The procedure’s ‘handles remote’ flag

Return type:

bool

Returns the procedure’s ‘handles remote’ flags as set with [method`FileProcedure`.set_handles_remote].

New in version 3.0.

get_magics()
Returns:

The procedure’s registered magics.

Return type:

str

Returns the procedure’s magics as set with [method`FileProcedure`.set_magics].

New in version 3.0.

get_mime_types()
Returns:

The procedure’s registered mime-types.

Return type:

str

Returns the procedure’s mime-type as set with [method`FileProcedure`.set_mime_types].

New in version 3.0.

get_prefixes()
Returns:

The procedure’s registered prefixes.

Return type:

str

Returns the procedure’s prefixes as set with [method`FileProcedure`.set_prefixes].

New in version 3.0.

get_priority()
Returns:

The procedure’s registered priority.

Return type:

int

Returns the procedure’s priority as set with [method`FileProcedure`.set_priority].

New in version 3.0.

set_extensions(extensions)
Parameters:

extensions (str) – A comma separated list of extensions this procedure can handle (i.e. “jpg,jpeg”).

Registers the given list of extensions as something this procedure can handle.

New in version 3.0.

set_format_name(format_name)
Parameters:

format_name (str) – A public-facing name for the format, e.g. “PNG”.

Associates a format name with a file handler procedure.

This name can be used for any public-facing strings, such as graphical interface labels. An example usage would be %GimpExportProcedureDialog title looking like “Export Image as %s”.

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

``c gimp_file_procedure_set_format_name (procedure, _(“JPEG”)); ``

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.

set_handles_remote(handles_remote)
Parameters:

handles_remote (bool) – The procedure’s ‘handles remote’ flag.

Registers a file procedure as capable of handling arbitrary remote URIs via GIO.

When handles_remote is set to True, the procedure will get a Gio.File passed that can point to a remote file.

When handles_remote is set to False, the procedure will get a local [iface`Gio`.File] passed and can use [method`Gio`.File.get_path] to get to a filename that can be used with whatever non-GIO means of dealing with the file.

New in version 3.0.

set_magics(magics)
Parameters:

magics (str) – A comma-separated list of magic file information (i.e. “0,string,GIF”).

Registers the list of magic file information this procedure can handle.

New in version 3.0.

set_mime_types(mime_types)
Parameters:

mime_types (str) – A comma-separated list of MIME types, such as “image/jpeg”.

Associates MIME types with a file handler procedure.

Registers MIME types for a file handler procedure. This allows GIMP to determine the MIME type of the file opened or saved using this procedure. It is recommended that only one MIME type is registered per file procedure; when registering more than one MIME type, GIMP will associate the first one with files opened or saved with this procedure.

New in version 3.0.

set_prefixes(prefixes)
Parameters:

prefixes (str) – A comma separated list of prefixes this procedure can handle (i.e. “http:,ftp:”).

It should almost never be necessary to register prefixes with file procedures, because most sorts of URIs should be handled by GIO.

New in version 3.0.

set_priority(priority)
Parameters:

priority (int) – The procedure’s priority.

Sets the priority of a file handler procedure.

When more than one procedure matches a given file, the procedure with the lowest priority is used; if more than one procedure has the lowest priority, it is unspecified which one of them is used. The default priority for file handler procedures is 0.

New in version 3.0.