Template¶
-
class
guerilla.
Template
¶ Bases:
object
The base class for templates returned by Node:gettemplate
-
insert
(subtemplate, where, find)¶ Insert a sub template into the given template
This function goes in the template hierarchy and insert the subtemplate at the requested position. For instance,template:insert (subtemplate, “after”, “Stereoscopy|LASTTAB”) will insert subtemplate in the Stereoscopy group, after the last tab. Recognized tokens are ‘^’ for the first item of a group, ‘$’ for the last item of a group, FIRSTTAB for the first tab of a group and LASTTAB for the last tab of a group.
param subtemplate: The subtemplate to insert type subtemplate: table param where: Either “before” or “after” type where: str param find: A ‘|’ separated path inside the template type find: str
-
static
registerfilter
(classname, filter)¶ Register a template filter for a specific class
This function lets you register a template filter for a base property template. The filter template is called when the propertiesof an object are queried, so a plugin can modify the default template
param classname: The name of the class to associate a filter to type classname: str param filter: The function called to fill the template. The function prototype is: table function (Node, template) type filter: function
-
strip
(find)¶ Strip a template of a part of its properties
This function removes parts of a template tree. For instance,template:strip (“Volumetric|.*Steps”) will strip any property in the Volumetric tab that matches ‘Steps’ Recognized tokens are ‘^’ for the first item of a group, ‘$’ for the last item of a group, FIRSTTAB for the first tab of a group and LASTTAB for the last tab of a group. Lua patterns are supported to match any part of a property or group name.
param find: A ‘|’ separated path inside the template type find: str
-