Nautilus.FileInfo

g GObject.GInterface GObject.GInterface Nautilus.FileInfo Nautilus.FileInfo GObject.GInterface->Nautilus.FileInfo

Implementations:

None

Methods

class

create (location)

class

create_for_uri (uri)

class

list_copy (files)

class

list_free (files)

class

lookup (location)

class

lookup_for_uri (uri)

add_emblem (emblem_name)

add_string_attribute (attribute_name, value)

can_write ()

get_activation_uri ()

get_file_type ()

get_location ()

get_mime_type ()

get_mount ()

get_name ()

get_parent_info ()

get_parent_location ()

get_parent_uri ()

get_string_attribute (attribute_name)

get_uri ()

get_uri_scheme ()

invalidate_extension_info ()

is_directory ()

is_gone ()

is_mime_type (mime_type)

Virtual Methods

do_add_emblem (emblem_name)

do_add_string_attribute (attribute_name, value)

do_can_write ()

do_get_activation_uri ()

do_get_file_type ()

do_get_location ()

do_get_mime_type ()

do_get_mount ()

do_get_name ()

do_get_parent_info ()

do_get_parent_location ()

do_get_parent_uri ()

do_get_string_attribute (attribute_name)

do_get_uri ()

do_get_uri_scheme ()

do_invalidate_extension_info ()

do_is_directory ()

do_is_gone ()

do_is_mime_type (mime_type)

Properties

None

Signals

None

Fields

None

Class Details

class Nautilus.FileInfo
Bases:

GObject.GInterface

Structure:

Nautilus.FileInfoInterface

File interface for nautilus extensions.

NautilusFileInfo provides methods to get and modify information about file objects in the file manager.

classmethod create(location)
Parameters:

location (Gio.File) – the location to create the file info for

Return type:

Nautilus.FileInfo

Get an existing NautilusFileInfo (if it exists) or create a new one is it does not exist.

classmethod create_for_uri(uri)
Parameters:

uri (str) – the URI to lookup the file info for

Return type:

Nautilus.FileInfo

Get an existing NautilusFileInfo (if it exists) or create a new one is it does not exist.

classmethod list_copy(files)
Parameters:

files ([Nautilus.FileInfo]) – the files to copy

Returns:

a copy of files. Use [func`FileInfo`.list_free] to free the list and unref its contents.

Return type:

[Nautilus.FileInfo]

Deep copy a list of NautilusFileInfo.

classmethod list_free(files)
Parameters:

files ([Nautilus.FileInfo]) – a list created with [func`FileInfo`.list_copy]

Deep free a list of NautilusFileInfo.

classmethod lookup(location)
Parameters:

location (Gio.File) – the location for which to look up a corresponding Nautilus.FileInfo object

Return type:

Nautilus.FileInfo or None

Get an existing NautilusFileInfo or NULL if it does not exist in the application cache.

classmethod lookup_for_uri(uri)
Parameters:

uri (str) – the URI to lookup the file info for

Return type:

Nautilus.FileInfo or None

Get an existing NautilusFileInfo or NULL if it does not exist in the application cache.

add_emblem(emblem_name)
Parameters:

emblem_name (str) – the name of an emblem

Add an emblem.

add_string_attribute(attribute_name, value)
Parameters:
  • attribute_name (str) – the name of an attribute

  • value (str) – the value of an attribute

Set’s the attributes value or replacing the existing value (if one exists).

This function is necessary to set the value of the NautilusFileInfo’s correspond attribute for a [property`Column`:py:data::attribute<Nautilus.FileInfo.props.attribute>].

can_write()
Returns:

True when self is writeable, and False otherwise

Return type:

bool

Gets whether the NautilusFileInfo is writeable.

get_activation_uri()
Returns:

the activation URI of self

Return type:

str

Gets the activation uri.

The activation uri may differ from the actual URI if e.g. the file is a .desktop file or a Nautilus XML link file.

get_file_type()
Returns:

the file type

Return type:

Gio.FileType

Get the cached [enum`Gio`.FileType].

get_location()
Returns:

the corresponding location.

Return type:

Gio.File

Get the corresponding [iface`Gio`.File]

get_mime_type()
Returns:

the MIME type of self

Return type:

str

Get the cached mime_type.

get_mount()
Returns:

the mount of self, or None if self has no mount

Return type:

Gio.Mount or None

Gets the cached mount.

This only returns the [iface`Gio`.Mount] if Nautilus has already cached it. The return value may be NULL even if the NautilusFileInfo has a corresponding mount in which case you can call [method`Gio`.File.find_enclosing_mount_async].

get_name()
Returns:

the file name of self

Return type:

str

Gets the name.

get_parent_info()
Returns:

a Nautilus.FileInfo for the parent of self, or None if self has no parent.

Return type:

Nautilus.FileInfo or None

Get the parent NautilusFileInfo.

It’s not safe to call this recursively multiple times, as it works only for files already cached by Nautilus.

get_parent_location()
Returns:

a Gio.File for the parent location of self, or None if self has no parent

Return type:

Gio.File or None

Gets the parent location.

get_parent_uri()
Returns:

the URI for the parent location of self, or the empty string if it has none

Return type:

str

Get the parent NautilusFileInfo uri.

get_string_attribute(attribute_name)
Parameters:

attribute_name (str) – the name of an attribute

Returns:

the value for the given attribute_name, or None if there is none

Return type:

str or None

Get the attribute’s value.

get_uri()
Returns:

the file URI of self

Return type:

str

Gets the URI.

get_uri_scheme()
Returns:

the URI scheme of self

Return type:

str

Get the uri scheme.

invalidate_extension_info()

Invalidate the current extension information.

This removes any information, such as emblems or or string attributes, that were added to the NautilusFileInfo from any extension.

is_directory()
Returns:

True when self is a directory, and False otherwise

Return type:

bool

Gets whether the NautilusFileInfo is a directory.

Uses the cached [enum`Gio`.FileType] matches G_FILE_TYPE_DIRECTORY without doing any blocking i/o.

is_gone()
Returns:

whether the file is gone.

Return type:

bool

Get whether a NautilusFileInfo is gone.

is_mime_type(mime_type)
Parameters:

mime_type (str) –

Returns:

True when the MIME type of self matches mime_type, and False otherwise

Return type:

bool

Gets whether the mime_type of the NautilusFileInfo matches the given type.

do_add_emblem(emblem_name) virtual
Parameters:

emblem_name (str) – the name of an emblem

Add an emblem.

do_add_string_attribute(attribute_name, value) virtual
Parameters:
  • attribute_name (str) – the name of an attribute

  • value (str) – the value of an attribute

Set’s the attributes value or replacing the existing value (if one exists).

This function is necessary to set the value of the NautilusFileInfo’s correspond attribute for a [property`Column`:py:data::attribute<Nautilus.FileInfo.props.attribute>].

do_can_write() virtual
Returns:

True when file_info is writeable, and False otherwise

Return type:

bool

Gets whether the NautilusFileInfo is writeable.

do_get_activation_uri() virtual
Returns:

the activation URI of file_info

Return type:

str

Gets the activation uri.

The activation uri may differ from the actual URI if e.g. the file is a .desktop file or a Nautilus XML link file.

do_get_file_type() virtual
Returns:

the file type

Return type:

Gio.FileType

Get the cached [enum`Gio`.FileType].

do_get_location() virtual
Returns:

the corresponding location.

Return type:

Gio.File

Get the corresponding [iface`Gio`.File]

do_get_mime_type() virtual
Returns:

the MIME type of file_info

Return type:

str

Get the cached mime_type.

do_get_mount() virtual
Returns:

the mount of file_info, or None if file_info has no mount

Return type:

Gio.Mount or None

Gets the cached mount.

This only returns the [iface`Gio`.Mount] if Nautilus has already cached it. The return value may be NULL even if the NautilusFileInfo has a corresponding mount in which case you can call [method`Gio`.File.find_enclosing_mount_async].

do_get_name() virtual
Returns:

the file name of file_info

Return type:

str

Gets the name.

do_get_parent_info() virtual
Returns:

a Nautilus.FileInfo for the parent of file_info, or None if file_info has no parent.

Return type:

Nautilus.FileInfo or None

Get the parent NautilusFileInfo.

It’s not safe to call this recursively multiple times, as it works only for files already cached by Nautilus.

do_get_parent_location() virtual
Returns:

a Gio.File for the parent location of file_info, or None if file_info has no parent

Return type:

Gio.File or None

Gets the parent location.

do_get_parent_uri() virtual
Returns:

the URI for the parent location of file_info, or the empty string if it has none

Return type:

str

Get the parent NautilusFileInfo uri.

do_get_string_attribute(attribute_name) virtual
Parameters:

attribute_name (str) – the name of an attribute

Returns:

the value for the given attribute_name, or None if there is none

Return type:

str or None

Get the attribute’s value.

do_get_uri() virtual
Returns:

the file URI of file_info

Return type:

str

Gets the URI.

do_get_uri_scheme() virtual
Returns:

the URI scheme of file_info

Return type:

str

Get the uri scheme.

do_invalidate_extension_info() virtual

Invalidate the current extension information.

This removes any information, such as emblems or or string attributes, that were added to the NautilusFileInfo from any extension.

do_is_directory() virtual
Returns:

True when file_info is a directory, and False otherwise

Return type:

bool

Gets whether the NautilusFileInfo is a directory.

Uses the cached [enum`Gio`.FileType] matches G_FILE_TYPE_DIRECTORY without doing any blocking i/o.

do_is_gone() virtual
Returns:

whether the file is gone.

Return type:

bool

Get whether a NautilusFileInfo is gone.

do_is_mime_type(mime_type) virtual
Parameters:

mime_type (str) –

Returns:

True when the MIME type of file_info matches mime_type, and False otherwise

Return type:

bool

Gets whether the mime_type of the NautilusFileInfo matches the given type.