OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __call__ (self, value, param=None, ctx=None) |
def | get_metavar (self, param) |
def | get_missing_message (self, param) |
def | convert (self, value, param, ctx) |
def | split_envvar_value (self, rv) |
def | fail (self, message, param=None, ctx=None) |
Static Public Attributes | |
bool | is_composite = False |
name = None | |
envvar_list_splitter = None | |
Helper for converting values through types. The following is necessary for a valid type: * it needs a name * it needs to pass through None unchanged * it needs to convert from a string * it needs to convert its result type through unchanged (eg: needs to be idempotent) * it needs to be able to deal with param and context being `None`. This can be the case when the object is used with prompt inputs.
def __call__ | ( | self, | |
value, | |||
param = None , |
|||
ctx = None |
|||
) |
def convert | ( | self, | |
value, | |||
param, | |||
ctx | |||
) |
Converts the value. This is not invoked for values that are `None` (the missing value).
Reimplemented in SeparatedPathType, CertParamType, Tuple, Path, File, UUIDParameterType, BoolParamType, FloatRange, FloatParamType, IntRange, IntParamType, DateTime, Choice, StringParamType, UnprocessedParamType, and FuncParamType.
def fail | ( | self, | |
message, | |||
param = None , |
|||
ctx = None |
|||
) |
Helper method to fail with an invalid value message.
def get_metavar | ( | self, | |
param | |||
) |
def get_missing_message | ( | self, | |
param | |||
) |
Optionally might return extra information about a missing parameter. .. versionadded:: 2.0
Reimplemented in Choice.
def split_envvar_value | ( | self, | |
rv | |||
) |
Given a value from an environment variable this splits it up into small chunks depending on the defined envvar list splitter. If the splitter is set to `None`, which means that whitespace splits, then leading and trailing whitespace is ignored. Otherwise, leading and trailing splitters usually lead to empty items being included.
|
static |
|
static |
|
static |