countchildren

guerilla.countchildren(node, type, pattern='', recursive=False)

Returns the number of children.

The countchildren function is written as:

LUA{ function countchildren (...)

local count = 0 for node in children (...) do

count = count+1

end return count

end }

param node:The parent node to count children
type node:Node
param type:A class the children to count
type type:str
param pattern:A Lua’s pattern used to check the name of the node, or a function that filter the node. See Lua’s pattern documentation.
type pattern:str or function
param recursive:
 if true, traverse the children recursively.
type recursive:bool