Tepl.FileLoader¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
|||
r/w/co |
|||
r/w/co |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Tepl.FileLoader(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(buffer, file)¶
- Parameters:
buffer (
Tepl.Buffer
) – theTepl.Buffer
to load the content into.
- Returns:
a new
Tepl.FileLoader
object.- Return type:
Creates a new
Tepl.FileLoader
object. The content is read from theTepl.File
location.If not already done, call
Tepl.File.set_location
() before calling this constructor. The previous location is anyway not needed, because as soon as the file loading begins, the buffer is emptied. Setting theTepl.File
location directly permits to update the UI, to display the good location when the file is loading.New in version 1.0.
- get_buffer()¶
- Returns:
the
Tepl.Buffer
to load the content into.- Return type:
Tepl.Buffer
orNone
New in version 1.0.
- load_async(io_priority, cancellable, callback, *user_data)¶
- Parameters:
io_priority (
int
) – the I/O priority of the request. E.g.GLib.PRIORITY_LOW
,GLib.PRIORITY_DEFAULT
orGLib.PRIORITY_HIGH
.cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfied.
Loads asynchronously the file content into the
Tepl.Buffer
.See the
Gio.AsyncResult
documentation to know how to use this function.New in version 5.0.
- load_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
.- Raises:
- Returns:
whether the content has been loaded successfully.
- Return type:
Finishes a file loading started with
Tepl.FileLoader.load_async
().New in version 1.0.
Property Details¶
- Tepl.FileLoader.props.buffer¶
- Name:
buffer
- Type:
- Default Value:
- Flags:
The
Tepl.Buffer
to load the content into. TheTepl.FileLoader
object has a weak reference to the buffer.New in version 1.0.
- Tepl.FileLoader.props.file¶
- Name:
file
- Type:
- Default Value:
- Flags:
The
Tepl.File
. TheTepl.FileLoader
object has a weak reference to the file.New in version 1.0.