Mirage.Contextual¶
- Implementations:
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class Mirage.Contextual¶
- Bases:
- Structure:
An object that can be attached a
Mirage.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.
This is a convenience function that retrieves a
Mirage.Context
from self and callsMirage.Context.create_input_stream
().
- 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 creates a chain of filter streams on top of it.
This is a convenience function that retrieves a
Mirage.Context
from self and callsMirage.Context.create_output_stream
().
- debug_is_active(level)¶
- Parameters:
level (
int
) – debug level- Returns:
a boolean indicating whether debug messages at debug level level are currently active or not.
- Return type:
Checks whether debug messages at debug level level are currently active or not.
- debug_print_buffer(level, prefix, width, buffer)¶
- Parameters:
Prints contents of buffer as a sequence of buffer_length two-digit hexadecimal numbers, arranged in lines of width numbers. Each line is optionally prefixed by prefix. If specified debug level is not active (masked by context), this function does nothing.
- get_context()¶
- Returns:
attached context (a
Mirage.Context
), orNone
. The reference to context is incremented, and should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Retrieves the attached context.
- get_option(name)¶
- Parameters:
name (
str
) – option name- Returns:
a
GLib.Variant
containing the option value on success,None
on failure.- Return type:
Retrieves option named name from the context.
This is a convenience function that retrieves a
Mirage.Context
from self and callsMirage.Context.get_option
().
- 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
().This is a convenience function that retrieves a
Mirage.Context
from self and callsMirage.Context.obtain_password
().
- set_context(context)¶
- Parameters:
context (
Mirage.Context
) – debug context (aMirage.Context
)
Sets/attaches a context.
- do_get_context() virtual¶
- Returns:
attached context (a
Mirage.Context
), orNone
. The reference to context is incremented, and should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Retrieves the attached context.
- do_set_context(context) virtual¶
- Parameters:
context (
Mirage.Context
) – debug context (aMirage.Context
)
Sets/attaches a context.