Nautilus.FileInfo¶
- Implementations:
None
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class Nautilus.FileInfo¶
- Bases:
- Structure:
File interface for nautilus extensions.
NautilusFileInfoprovides 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:
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:
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:
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 correspondingNautilus.FileInfoobject- Return type:
Get an existing
NautilusFileInfoorNULLif 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:
Get an existing
NautilusFileInfoorNULLif it does not exist in the application cache.
- add_string_attribute(attribute_name, value)¶
-
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()¶
-
Gets whether the
NautilusFileInfois writeable.
- get_activation_uri()¶
- Returns:
the activation URI of self
- Return type:
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:
Get the cached [enum`Gio`.FileType].
- get_location()¶
- Returns:
the corresponding location.
- Return type:
Get the corresponding [iface`Gio`.File]
- get_mount()¶
-
Gets the cached mount.
This only returns the [iface`Gio`.Mount] if Nautilus has already cached it. The return value may be
NULLeven if theNautilusFileInfohas a corresponding mount in which case you can call [method`Gio`.File.find_enclosing_mount_async].
- get_parent_info()¶
- Returns:
a
Nautilus.FileInfofor the parent of self, orNoneif self has no parent.- Return type:
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()¶
-
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:
Get the parent
NautilusFileInfouri.
- get_string_attribute(attribute_name)¶
- Parameters:
attribute_name (
str) – the name of an attribute- Returns:
the value for the given attribute_name, or
Noneif there is none- Return type:
Get the attribute’s value.
- invalidate_extension_info()¶
Invalidate the current extension information.
This removes any information, such as emblems or or string attributes, that were added to the
NautilusFileInfofrom any extension.
- is_directory()¶
-
Gets whether the
NautilusFileInfois a directory.Uses the cached [enum`Gio`.FileType] matches
G_FILE_TYPE_DIRECTORYwithout doing any blocking i/o.
- is_gone()¶
- Returns:
whether the file is gone.
- Return type:
Get whether a
NautilusFileInfois gone.
- is_mime_type(mime_type)¶
- Parameters:
mime_type (
str) –- Returns:
Truewhen the MIME type of self matches mime_type, andFalseotherwise- Return type:
Gets whether the mime_type of the
NautilusFileInfomatches 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¶
-
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¶
-
Gets whether the
NautilusFileInfois writeable.
- do_get_activation_uri() virtual¶
- Returns:
the activation URI of file_info
- Return type:
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:
Get the cached [enum`Gio`.FileType].
- do_get_location() virtual¶
- Returns:
the corresponding location.
- Return type:
Get the corresponding [iface`Gio`.File]
- do_get_mime_type() virtual¶
- Returns:
the MIME type of file_info
- Return type:
Get the cached mime_type.
- do_get_mount() virtual¶
-
Gets the cached mount.
This only returns the [iface`Gio`.Mount] if Nautilus has already cached it. The return value may be
NULLeven if theNautilusFileInfohas a corresponding mount in which case you can call [method`Gio`.File.find_enclosing_mount_async].
- do_get_parent_info() virtual¶
- Returns:
a
Nautilus.FileInfofor the parent of file_info, orNoneif file_info has no parent.- Return type:
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.Filefor the parent location of file_info, orNoneif file_info has no parent- Return type:
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:
Get the parent
NautilusFileInfouri.
- 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
Noneif there is none- Return type:
Get the attribute’s value.
- do_get_uri_scheme() virtual¶
- Returns:
the URI scheme of file_info
- Return type:
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
NautilusFileInfofrom any extension.
- do_is_directory() virtual¶
-
Gets whether the
NautilusFileInfois a directory.Uses the cached [enum`Gio`.FileType] matches
G_FILE_TYPE_DIRECTORYwithout doing any blocking i/o.
- do_is_gone() virtual¶
- Returns:
whether the file is gone.
- Return type:
Get whether a
NautilusFileInfois gone.