gio Functions
Prev | PyGio Class Reference | Next

## gio Functions

gio Functions

## Synopsis

        def gio.content_type_can_be_executable(type)
        def gio.content_type_equals(type1, type2)
        def gio.content_type_from_mime_type(mime_type)
        def gio.content_type_get_description(type)
        def gio.content_type_get_icon(type)
        def gio.content_type_get_mime_type(type)
        def gio.content_type_guess(filename, data, want_uncertain)
        def gio.content_type_is_a(type, supertype)
        def gio.content_type_is_unknown(type)
        def gio.content_types_get_registered()
        def gio.io_error_from_errno(err_no)

## Description

These functions are part of the `PyGObject` gio module but are not directly associated with a specific class

## Functions

### gio.content_type_can_be_executable

        def content_type_can_be_executable(type)

`type` : | a content type string.
Returns : | `True` if the file type corresponds to a type that can be executable, `False` otherwise.

The `content_type_can_be_executable`() function checks if a content type can be executable. Note that for instance things like text files can be executables (i.e. scripts and batch files).

### gio.content_type_equals

        def content_type_equals(type1, type2)

`type1` : | a content type string.
`type2` : | a content type string.
Returns : | `True` if the two strings are identical or equivalent, `False` otherwise.

The `content_type_equals`() function compares two content types for equality.

### gio.content_type_from_mime_type

        def content_type_from_mime_type(mime_type)

`mime_type` : | a mime type string.
Returns : | The content type or `None` when does not know.

The `content_type_from_mime_type`() function tries to find a content type based on the mime type name.

### gio.content_type_get_description

        def content_type_get_description(type)

`type` : | a content type string.
Returns : | a short description of the content type type.

The `content_type_get_description`() function gets the human readable description of the content type.

### gio.content_type_get_icon

        def content_type_get_icon(type)

`type` : | a content type string.
Returns : | A `gio.Icon` corresponding to the content type.

The `content_type_get_icon`() function gets the icon for a content type.

### gio.content_type_get_mime_type

        def content_type_get_mime_type(type)

`type` : | a content type string.
Returns : | the registered mime-type for the given type, or `None` if unknown.

The `content_type_get_mime_type`() function gets the mime-type for the content type. If one is registered

### gio.content_type_guess

        def content_type_guess(filename, data, want_uncertain)

`filename` : | a string, or `None`.
`data` : | a stream of data, or `None`.
`want_uncertain` : | a flag indicating the certainty of the result.
Returns : | a string indicating a guessed content type for the given data.

The `content_type_guess`() function guesses the content type based on example data. If the function is uncertain, result_uncertain will be set to `True`. Either filename or data may be `None`, in which case the guess will be based solely on the other argument.

### gio.content_type_is_a

        def content_type_is_a(type, supertype)

`type` : | a content type string.
`supertype` : | a string.
Returns : | `True` if type is a kind of supertype, `False` otherwise.

The `content_type_is_a`() function determines if type is a subset of supertype.

### gio.content_type_is_unknown

        def content_type_is_unknown(type)

`type` : | a content type string.
Returns : | `True` if the type is the unknown type.

The `content_type_is_unknown`() function checks if the content type is the generic "unknown" type. On unix this is the "application/octet-stream" mimetype, while on win32 it is "*".

### gio.content_types_get_registered

        def content_types_get_registered()

Returns : | a list of the registered content types.

The `content_types_get_registered`() function gets a list of strings containing all the registered content types known to the system.

### gio.io_error_from_errno

        def io_error_from_errno(err_no)

`err_no` : | Error number.
Returns : | a Gio Error Constants

The `io_error_from_errno`() function converts error codes into GIO error codes.

Prev | Up | Next
gio.VolumeMonitor | Home | gio Constants