thunarx.FileInfo

thunarx.FileInfo — thunarx.FileInfo Reference

Synopsis

class thunarx.FileInfo(gobject.GInterface):
    def get_name()
def get_uri()
def get_parent_uri()
def get_uri_scheme()
def get_mime_type()
def has_mime_type(mime_type)
def is_directory()
def get_file_info()
def get_filesystem_info()
def get_location()
def changed()
def renamed()

Ancestry

+-- gobject.GInterface
    +-- thunarx.FileInfo

Description

Each thunarx.FileInfo object is an abstraction of a real file.

Signals

"changed"

def callback()

"renamed"

def callback()

Public Methods

thunarx.FileInfo.get_name

    def get_name()

Returns :

Returns the real name of the file represented by file_info in the local file system encoding.

thunarx.FileInfo.get_uri

    def get_uri()

Returns :

Returns the escaped, fully qualified URI of the file object represented by file_info.

thunarx.FileInfo.get_parent_uri

    def get_parent_uri()

Returns :

Returns the URI to the parent file of file_info or NULL if file_info has no parent. Note that the parent URI may be of a different type than the URI of file_info. For example, the parent of "file:///" is "computer:///".

thunarx.FileInfo.get_uri_scheme

    def get_uri_scheme()

Returns :

Returns the URI scheme of the file represented by file_info. E.g. if file_info refers to the file "file:///usr/home", the return value will be "file".

thunarx.FileInfo.get_mime_type

    def get_mime_type()

Returns :

Returns the MIME-type of the file represented by file_info or NULL if no MIME-type is known for file_info.

thunarx.FileInfo.has_mime_type

    def has_mime_type()

mime_type :

the mime_type to check for

Returns :

Checks whether file_info is of the given mime_type or whether the MIME-type of file_info is a subclass of mime_type. This is the preferred way for most extensions to check whether they support a given file or not, and you should consider using this method rather than thunarx.FileInfo.get_mime_type(). A simple example would be a menu extension that performs a certain action on text files. In this case you want to check whether a given thunarx.FileInfo refers to any kind of text file, not only to "text/plain" (e.g. this also includes "text/xml" and "application/x-desktop"). But you should be aware that this method may take some time to test whether mime_type is valid for file_info, so don't call it too often.

thunarx.FileInfo.is_directory

    def is_directory()

Returns :

Checks whether file_info refers to a directory.

thunarx.FileInfo.get_file_info

    def get_file_info()

Returns :

Returns the GFileInfo object associated with file_info, which includes additional information about the file_info as queried from GIO earlier.

thunarx.FileInfo.get_filesystem_info

    def get_filesystem_info()

Returns :

Returns the GFileInfo which includes additional information about the filesystem file_info resides on.

thunarx.FileInfo.get_location

    def get_location()

Returns :

Returns the GFile file_info points to. The GFile is a more powerful tool than just the URI or the path.

thunarx.FileInfo.changed

    def changed()

Returns :

Emits the ::changed signal on file_info. This method should not be invoked by Thunar plugins, instead the file manager itself will use this method to emit ::changed whenever it notices a change on file_info.

thunarx.FileInfo.renamed

    def renamed()

Returns :

Emits the ::renamed signal on file_info. This method should not be invoked by Thunar plugins, instead the file manager will emit this signal whenever the user renamed the file_info. The plugins should instead connect to the ::renamed signal and update it's internal state and it's user interface after the file manager renamed a file.

Signal Details

The "changed" thunarx.FileInfo Signal

Emitted whenever the system notices a change to file_info.

Thunar plugins should use this signal to stay informed about changes to a file_info for which they currently display information (i.e. in a thunarx.PropertyPage), and update it's user interface whenever a change is noticed on file_info.

The "renamed" thunarx.FileInfo Signal

Emitted when the file_info is renamed to another name.

For example, within Thunar, ThunarFolder uses this signal to reregister it's VFS directory monitor, after the corresponding file was renamed.