OpenQuizz
Une application de gestion des contenus pédagogiques
FloatRange Class Reference
Inheritance diagram for FloatRange:
Collaboration diagram for FloatRange:

Public Member Functions

def __init__ (self, min=None, max=None, clamp=False)
 
def convert (self, value, param, ctx)
 
def __repr__ (self)
 
- Public Member Functions inherited from ParamType
def __call__ (self, value, param=None, ctx=None)
 
def get_metavar (self, param)
 
def get_missing_message (self, param)
 
def split_envvar_value (self, rv)
 
def fail (self, message, param=None, ctx=None)
 

Data Fields

 min
 
 max
 
 clamp
 

Static Public Attributes

string name = "float range"
 
- Static Public Attributes inherited from FloatParamType
string name = "float"
 
- Static Public Attributes inherited from ParamType
bool is_composite = False
 
 name = None
 
 envvar_list_splitter = None
 

Detailed Description

A parameter that works similar to :data:`click.FLOAT` but restricts
the value to fit into a range.  The default behavior is to fail if the
value falls outside the range, but it can also be silently clamped
between the two edges.

See :ref:`ranges` for an example.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  min = None,
  max = None,
  clamp = False 
)

Member Function Documentation

◆ __repr__()

def __repr__ (   self)

Reimplemented from FloatParamType.

◆ convert()

def convert (   self,
  value,
  param,
  ctx 
)
Converts the value.  This is not invoked for values that are
`None` (the missing value).

Reimplemented from FloatParamType.

Field Documentation

◆ clamp

clamp

◆ max

max

◆ min

min

◆ name

string name = "float range"
static

The documentation for this class was generated from the following file: