Tepl.FileLoader

g GObject.Object GObject.Object Tepl.FileLoader Tepl.FileLoader GObject.Object->Tepl.FileLoader

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (buffer, file)

get_buffer ()

get_file ()

get_location ()

load_async (io_priority, cancellable, callback, *user_data)

load_finish (result)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

buffer

Tepl.Buffer

r/w/co

file

Tepl.File

r/w/co

location

Gio.File

r/w/co

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Tepl.FileLoader(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Tepl.FileLoaderClass

classmethod new(buffer, file)
Parameters:
Returns:

a new Tepl.FileLoader object.

Return type:

Tepl.FileLoader

Creates a new Tepl.FileLoader object. The content is read from the Tepl.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 the Tepl.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 or None

New in version 1.0.

get_file()
Returns:

the Tepl.File.

Return type:

Tepl.File or None

New in version 1.0.

get_location()
Returns:

the Gio.File to load.

Return type:

Gio.File or None

New in version 1.0.

load_async(io_priority, cancellable, callback, *user_data)
Parameters:

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) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

whether the content has been loaded successfully.

Return type:

bool

Finishes a file loading started with Tepl.FileLoader.load_async().

New in version 1.0.

Property Details

Tepl.FileLoader.props.buffer
Name:

buffer

Type:

Tepl.Buffer

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Tepl.Buffer to load the content into. The Tepl.FileLoader object has a weak reference to the buffer.

New in version 1.0.

Tepl.FileLoader.props.file
Name:

file

Type:

Tepl.File

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Tepl.File. The Tepl.FileLoader object has a weak reference to the file.

New in version 1.0.

Tepl.FileLoader.props.location
Name:

location

Type:

Gio.File

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Gio.File to load. By default the location is taken from the Tepl.File at construction time.

New in version 1.0.