Collector

Collector

class Collector[source]

Bases: abc.ABC, Generic[configpile.collector._Value]

Collects argument instances and computes the final value

Methods

append

Returns a collector that appends sequences

arg_required

Returns whether one instance of the argument needs to be present

argparse_argument_kwargs

Returns the arguments using in documentation (piggy backing on argparse)

collect

Collects a sequence of values into a result

keep_last

Returns a collector that keeps the last value

List of members of Collector

abstract arg_required()[source]

Returns whether one instance of the argument needs to be present

Return type

bool

abstract collect(seq)[source]

Collects a sequence of values into a result

Parameters

seq (Sequence[TypeVar(_Value)]) – Sequence of parsed values

Return type

Union[TypeVar(_Value), Err]

Returns

Either the consolidated value or an error

abstract argparse_argument_kwargs()[source]

Returns the arguments using in documentation (piggy backing on argparse)

Return type

Mapping[str, Any]

static keep_last()[source]

Returns a collector that keeps the last value

Return type

Collector[TypeVar(_Value)]

static append()[source]

Returns a collector that appends sequences

Return type

Collector[Sequence[TypeVar(_Item)]]

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