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

classmethod create(location)
Parameters:

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

Returns:

a Nautilus.FileInfo

Return type:

Nautilus.FileInfo

classmethod create_for_uri(uri)
Parameters:

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

Returns:

a Nautilus.FileInfo

Return type:

Nautilus.FileInfo

classmethod list_copy(files)
Parameters:

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

Returns:

a copy of files. Use Nautilus.FileInfo.list_free to free the list and unref its contents.

Return type:

[Nautilus.FileInfo]

classmethod list_free(files)
Parameters:

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

classmethod lookup(location)
Parameters:

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

Returns:

a Nautilus.FileInfo

Return type:

Nautilus.FileInfo or None

classmethod lookup_for_uri(uri)
Parameters:

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

Returns:

a Nautilus.FileInfo

Return type:

Nautilus.FileInfo or None

add_emblem(emblem_name)
Parameters:

emblem_name (str) – the name of an emblem

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

  • value (str) – the name of an attribute

can_write()
Returns:

True when self is writeable, and False otherwise

Return type:

bool

get_activation_uri()
Returns:

the activation URI of self, which may differ from the actual URI if e.g. the file is a .desktop file or a Nautilus XML link file

Return type:

str

get_file_type()
Returns:

a Gio.FileType for the location of self

Return type:

Gio.FileType

get_location()
Returns:

a Gio.File for the location of self

Return type:

Gio.File

get_mime_type()
Returns:

the MIME type of self

Return type:

str

get_mount()
Returns:

a Gio.Mount for the mount of self, or None if self has no mount

Return type:

Gio.Mount or None

get_name()
Returns:

the file name of self

Return type:

str

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

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

get_parent_uri()
Returns:

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

Return type:

str

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_uri()
Returns:

the file URI of self

Return type:

str

get_uri_scheme()
Returns:

the URI scheme of self

Return type:

str

invalidate_extension_info()
is_directory()
Returns:

True when self is a directory, and False otherwise

Return type:

bool

is_gone()
Returns:

whether the file has been deleted

Return type:

bool

is_mime_type(mime_type)
Parameters:

mime_type (str) – a MIME type

Returns:

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

Return type:

bool

do_add_emblem(emblem_name) virtual
Parameters:

emblem_name (str) – the name of an emblem

Adds an emblem to this file. See Nautilus.FileInfo.add_emblem() for details.

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

  • value (str) – the name of an attribute

Sets the specified string file attribute value. See Nautilus.FileInfo.add_string_attribute() for details.

do_can_write() virtual
Returns:

True when file_info is writeable, and False otherwise

Return type:

bool

Returns whether the file is writable. See Nautilus.FileInfo.can_write() for details.

do_get_activation_uri() virtual
Returns:

the activation URI of file_info, which may differ from the actual URI if e.g. the file is a .desktop file or a Nautilus XML link file

Return type:

str

Returns the file activation URI as a string. See Nautilus.FileInfo.get_activation_uri() for details.

do_get_file_type() virtual
Returns:

a Gio.FileType for the location of file_info

Return type:

Gio.FileType

Returns the file type. See Nautilus.FileInfo.get_file_type() for details.

do_get_location() virtual
Returns:

a Gio.File for the location of file_info

Return type:

Gio.File

Returns the file location as a Gio.File. See Nautilus.FileInfo.get_location() for details.

do_get_mime_type() virtual
Returns:

the MIME type of file_info

Return type:

str

Returns the file mime type as a string. See Nautilus.FileInfo.get_mime_type() for details.

do_get_mount() virtual
Returns:

a Gio.Mount for the mount of file_info, or None if file_info has no mount

Return type:

Gio.Mount or None

Returns the file mount as a Gio.Mount. See Nautilus.FileInfo.get_mount() for details.

do_get_name() virtual
Returns:

the file name of file_info

Return type:

str

Returns the file name as a string. See Nautilus.FileInfo.get_name() for details.

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

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

Returns the file parent location as a Gio.File. See Nautilus.FileInfo.get_parent_location() for details.

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

Returns the file parent URI as a string. See Nautilus.FileInfo.get_parent_uri() for details.

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

Returns the specified file attribute as a string. See Nautilus.FileInfo.get_string_attribute() for details.

do_get_uri() virtual
Returns:

the file URI of file_info

Return type:

str

Returns the file URI as a string. See Nautilus.FileInfo.get_uri() for details.

do_get_uri_scheme() virtual
Returns:

the URI scheme of file_info

Return type:

str

Returns the file URI scheme as a string. See Nautilus.FileInfo.get_uri_scheme() for details.

do_invalidate_extension_info() virtual

Invalidates information of the file provided by extensions. See Nautilus.FileInfo.invalidate_extension_info() for details.

do_is_directory() virtual
Returns:

True when file_info is a directory, and False otherwise

Return type:

bool

Returns whether the file is a directory. See Nautilus.FileInfo.is_directory() for details.

do_is_gone() virtual
Returns:

whether the file has been deleted

Return type:

bool

Returns whether the file info is gone. See Nautilus.FileInfo.is_gone() for details.

do_is_mime_type(mime_type) virtual
Parameters:

mime_type (str) – a MIME type

Returns:

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

Return type:

bool

Returns whether the file is the given mime type. See Nautilus.FileInfo.is_mime_type() for details.