Template.TemplateLocator

g GObject.Object GObject.Object Template.TemplateLocator Template.TemplateLocator GObject.Object->Template.TemplateLocator

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

append_search_path (path)

get_search_path ()

locate (path)

prepend_search_path (path)

Virtual Methods

Inherited:

GObject.Object (7)

do_locate (path)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Template.TemplateLocator(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Template.TemplateLocatorClass

The #TmplTemplateLoader class is used to specify how templates should be loaded. This can be used directly by your code that will compile the data streams into Template.Template instances, or by a Template.Template that is resolving includes from the {{include "path.tmpl"}} directive.

See Template.Template :locator for more information.

classmethod new()
Return type:

Template.TemplateLocator

append_search_path(path)
Parameters:

path (str) –

get_search_path()
Returns:

A None-terminated array of strings.

Return type:

[str]

Gets the current search path used by the template locator.

locate(path)
Parameters:

path (str) – a relative path to the file

Raises:

GLib.Error

Returns:

A Gio.InputStream or None and error is set.

Return type:

Gio.InputStream

This will resolve the relative path using the search paths found within the template loader.

prepend_search_path(path)
Parameters:

path (str) –

do_locate(path) virtual
Parameters:

path (str) – a relative path to the file

Returns:

A Gio.InputStream or None and error is set.

Return type:

Gio.InputStream

This will resolve the relative path using the search paths found within the template loader.