KVParam

KVParam

class KVParam[source]

Bases: configpile.handlers.KVHandler, Generic[configpile.handlers._Value]

Handler for the value following a key corresponding to a parameter

Attributes

Note: attributes inherited from parent classes are not shown here, if any

param

Parameter to handle

Methods

action

A method called on the successful parse of a value

handle

Processes

List of members of KVParam

param: configpile.arg.Param[configpile.handlers._Value]

Parameter to handle

action(value, state)[source]

A method called on the successful parse of a value

Can be overridden. By default does nothing.

Parameters
  • value (TypeVar(_Value)) – Parsed value

  • state (State) – State to possibly update

Return type

Optional[Err]

Returns

An optional error

handle(value, state)[source]

Processes

Parameters
  • value (str) – Value to parse and process

  • state (State) – State to update

Return type

Optional[Err]

Returns

An error if an error occurred

__init__(param)
static __new__(cls, *args, **kwds)