Mirage.Context¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Mirage.Context(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
All the fields in the
Mirage.Context
structure are private to theMirage.Context
implementation and should never be accessed directly.- clear_options()¶
Clears all the options from the context.
- create_input_stream(filename)¶
- Parameters:
filename (
str
) – filename to create input stream on- Raises:
- Returns:
on success, an object implementing
Mirage.Stream
interface is returned, which can be used to access data stored in file. On failure,None
is returned. The reference to the object should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Opens a file pointed to by filename and creates a chain of filter streams on top of it.
- create_output_stream(filename, filter_chain)¶
- Parameters:
- Raises:
- Returns:
on success, an object implementing
Mirage.Stream
interface is returned, which can be used to write data to file. On failure,None
is returned. The reference to the object should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Opens a file pointed to by filename and optionally creates a chain of filter streams on top of it.
The chain of filters is described by filter-chain, which is a
None
-terminated array of strings corresponding to type names of filters, with the last filter being the one on the top. Filters are passed by their name types because their actual type values are determined when the plugins are loaded. If invalid filter is specified in the chain, this function will fail. It is the caller’s responsibility to construct a valid filter chain.
- get_debug_domain()¶
- Returns:
pointer to buffer containing the domain name, or
None
. The buffer belongs to the object and should not be modified.- Return type:
Retrieves debug context’s domain name.
- get_debug_mask()¶
- Returns:
debug context’s debug mask
- Return type:
Retrieves debug context’s debug mask.
- get_debug_name()¶
- Returns:
pointer to buffer containing the name, or
None
. The buffer belongs to the object and should not be modified.- Return type:
Retrieves debug context’s name.
- get_option(name)¶
- Parameters:
name (
str
) – option name- Returns:
pointer to a
GLib.Variant
containing the option value on success,None
on failure.- Return type:
Retrieves option named name from the context.
- load_image(filenames)¶
- Parameters:
filenames ([
str
]) – filename(s)- Raises:
- Returns:
a
Mirage.Disc
object on success,None
on failure. The reference to the object should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Creates a
Mirage.Disc
object representing image stored in filenames. filenames is aNone
-terminated list of filenames containing image data. The function tries to find a parser that can handle give filename(s) and uses it to load the data into disc object.If multiple filenames are provided and parser supports only single-file images, only the first filename is used.
- obtain_password()¶
- Raises:
- Returns:
password string on success,
None
on failure. The string should be freed withGLib.free
() when no longer needed.- Return type:
Obtains password string, using the
Mirage.PasswordFunction
callback that was provided viaMirage.Context.set_password_function
().
- set_debug_domain(domain)¶
- Parameters:
domain (
str
) – domain name
Sets debug context’s domain name to domain.
- set_debug_mask(debug_mask)¶
- Parameters:
debug_mask (
int
) – debug mask
Sets debug context’s debug mask.
- set_option(name, value)¶
- Parameters:
name (
str
) – option namevalue (
GLib.Variant
) – option value
Sets an option to the context. If option with the specified name already exists, it is replaced.
- set_password_function(func, *user_data)¶
- Parameters:
func (
Mirage.PasswordFunction
orNone
) – a password function pointeruser_data (
object
orNone
) – pointer to user data to be passed to the password function
Sets the password function to context. The function is used by parsers that support encrypted images to obtain password for unlocking such images.
Both func and user_data can be
None
; in that case the appropriate setting will be reset.