Dynamic option description: DynOptionDescription
Dynamic option description
Dynamic option description is an OptionDescription which multiplies according to the return of a function.
Parameter |
Comments |
|---|---|
name |
The |
doc |
The |
children |
The list of children (Option) include inside. Note:: the option can be an Instanciate an option or an other option description |
suffixes |
Suffixes is a Calculation that return the list of suffixes used to create dynamic option description. |
properties |
A list of Properties (inside a frozenset(). |
Example
Let’s try:
>>> from tiramisu import StrOption, DynOptionDescription, Calculation
>>> def return_suffixes():
... return ['1', '2']
>>> child1 = StrOption('first', 'First basic option ')
>>> child2 = StrOption('second', 'Second basic option ')
>>> DynOptionDescription('basic ',
... 'Basic options ',
... [child1, child2],
... Calculation(return_suffixes))
This example will construct:
Basic options 1:
First basic option 1
Second basic option 1
Basic options 2:
First basic option 2
Second basic option 2