option#
- pulserver.design.option()[source]#
Declare a plugin option at user entry
userand return the value the plugin is loaded with.A plugin assigns it to a module constant at module level, before its
SequencePluginsubclass, whose class body reads it, so the option shapes the sequence function and the protocol the plugin declares. The subclass lists the option asuser<user>_value, the index of its value amongchoices(0 or 1 for a flag), namedlabeland the code of each choice inuser<user>_name. A design call loads the plugin at the options its request holds in those entries; outsideload_plugin()the value isdefault.- Parameters:
name (str) – The option’s name, which a design’s manifest records it by.
default (bool, int, float or str) – Its value where the request does not state it.
choices (tuple, default=()) – Its values,
defaultamong them, at most five; a flag, whose default is a bool, takes none and chooses betweenFalseandTrue.user (int) – The user entry it is listed at.
label (str) – The option’s name on the console.
- Raises:
OptionError – If a flag is given choices, any other option is not,
defaultis not among them, there are more than five oruseris not a user entry; or, while a plugin loads, ifnameoruseris declared twice or the value it is loaded with is not among the choices.