Template.Scope¶
Fields¶
None
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Template.Scope¶
- classmethod new()¶
- Returns:
A newly created
Template.Scope.- Return type:
Creates a new scope to contain variables and custom expressions,
- dup_string(name)¶
-
Gets a string if the symbol name is a string.
Otherwise,
Noneis returned.New in version 3.36.
- get(name)¶
- Parameters:
name (
str) –- Returns:
- Return type:
If the symbol could not be found, it will be allocated.
- list_symbols(recursive)¶
- Parameters:
recursive (
bool) – if the parent scopes should be included- Returns:
an array containing the names of all symbols within the scope.
- Return type:
[
str]
Gets the names of all symbols within the scope.
- new_with_parent()¶
- Returns:
A newly created
Template.Scope.- Return type:
Creates a new scope to contain variables and custom expressions, If self is set, the parent scope will be inherited.
- peek(name)¶
- Parameters:
name (
str) –- Returns:
A
Template.SymbolorNone.- Return type:
If the symbol could not be found,
Noneis returned.
- ref()¶
- Return type:
- require(namespace_, version)¶
- Parameters:
- Returns:
- Return type:
Imports namespace_ into self so it can be used by expressions.
- set(name, symbol)¶
- Parameters:
name (
str) – the name of the symbolsymbol (
Template.SymbolorNone) – AnTemplate.SymbolorNone.
If the symbol already exists, it will be overwritten.
If symbol is
None, the symbol will be removed from scope.
- set_object(name, value)¶
- Parameters:
name (
str) – a name for the symbolvalue (
GObject.ObjectorNone) – aGObject.ObjectorNone.
Sets the value of the symbol named name to the object value.
- set_resolver(resolver, *user_data)¶
- Parameters:
resolver (
Template.ScopeResolver) –
- set_string(name, value)¶
-
Sets the value of the symbol named name to a string matching value.
- set_strv(name, value)¶
- Parameters:
Sets the value of the symbol named name to the strv value.
- set_value(name, value)¶
- Parameters:
name (
str) – a name for the symbolvalue (
GObject.ValueorNone) – AGObject.ValueorNone
Sets the contents of the symbol named name to the value value.
- set_variant(name, value)¶
- Parameters:
name (
str) – a name for the symbolvalue (
GLib.VariantorNone) – the variant to set it to, orNone
Sets the value of the symbol named name to the variant value.
If value has a floating reference, it is consumed.
- take(name, symbol)¶
- Parameters:
name (
str) – The name of the symbolsymbol (
Template.SymbolorNone) – ATemplate.SymbolorNone
Sets the symbol named name to symbol in scope.
This differs from
Template.Scope.set() in that it takes ownership of symbol.
- unref()¶