gui.model.FormField

gui.model.FormField(
    dest,
    key,
    flag,
    kind,
    default,
    help,
    choices=(),
    required=False,
)

One option of a command, as the form shows it.

Attributes

Name Type Description
dest str The attribute name the parser stores the value under.
key str The long option without dashes, as cli_argv takes it.
flag str The long option with dashes.
kind str "flag", "text", "int", "float", "path", "choice" or "repeat".
default object The default of the parser, or None.
help str The help text of the parser.
choices tuple[str, …] The allowed values of a "choice", else empty.
required bool Whether the parser requires the option.

Examples

from spotregen.gui.model import form_fields

field = form_fields("mutate")[0]
print(field.flag, field.kind, field.default)
--max int None