Foundry.FileManager

g Foundry.Contextual Foundry.Contextual Foundry.Service Foundry.Service Foundry.Contextual->Foundry.Service Foundry.FileManager Foundry.FileManager Foundry.Service->Foundry.FileManager GObject.GInterface GObject.GInterface Json.Serializable Json.Serializable GObject.GInterface->Json.Serializable GObject.Object GObject.Object GObject.Object->Foundry.Contextual Json.Serializable->Foundry.Contextual

Subclasses:

None

Methods

Inherited:

Foundry.Service (8), Foundry.Contextual (4), GObject.Object (37), Json.Serializable (8)

Structs:

Foundry.ServiceClass (3), GObject.ObjectClass (5)

find_symbolic_icon (content_type, filename)

guess_language (file, content_type, contents)

list_languages ()

read_metadata (file, attributes)

search (options, operation)

show (file)

write_metadata (file, file_info)

Virtual Methods

Inherited:

GObject.Object (7), Json.Serializable (5)

Properties

Inherited:

Foundry.Contextual (1)

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Foundry.FileManager(**kwargs)
Bases:

Foundry.Service

Abstract:

No

Structure:

Foundry.FileManagerClass

Manages file operations and provides file system abstraction.

Foundry.FileManager handles file creation, deletion, monitoring, and provides a unified interface for working with files across different backends. It also manages file attributes, search functionality, and integrates with the VCS system for version control operations.

find_symbolic_icon(content_type, filename)
Parameters:
  • content_type (str or None) – optional content-type to lookup

  • filename (str or None) – optional filename

Returns:

A Gio.Icon or None

Return type:

Gio.Icon or None

Either content_type or filename should be provided, or both.

This function is similar to Gio.content_type_get_symbolic_icon() except that it takes our bundled icons into account to ensure that they are taken at a higher priority than the fallbacks from the current icon theme.

guess_language(file, content_type, contents)
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a string containing the language identifier, or rejects with error.

Return type:

Dex.Future

Attempts to guess the language of file, content_type, or contents.

One of file, content_type, or contents must be set.

list_languages()
Return type:

[str]

read_metadata(file, attributes)
Parameters:
  • file (Gio.File) – a [iface`Gio`.File]

  • attributes (str) – a string containing the metadata:: attributes to query separated by a comma “,”

Returns:

a [class`Dex`.Future] that resolves to a [class`Gio`.FileInfo].

Return type:

Dex.Future

Reads the metadata associated with a file.

search(options, operation)
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.ListModel] of [class`Foundry`.FileSearchMatch] or rejects with error.

Return type:

Dex.Future

This function will complete before the operation has fully completed searching all targets. You may wait for all search results to be populated by using [func`Foundry`.list_model_await].

New in version 1.1.

show(file)
Parameters:

file (Gio.File) –

Returns:

a [class`Dex`.Future] that resolves to true if successful

Return type:

Dex.Future

Requests that file is shown in the users default file-manager.

For example, on GNOME this would open Nautilus.

write_metadata(file, file_info)
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a boolean or rejects with error.

Return type:

Dex.Future

file_info must only contain attributes starting with ‘metadata::’