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

Public Member Functions

def __init__ (self, param_decls, required=None, **attrs)
 
def human_readable_name (self)
 
def make_metavar (self)
 
def get_usage_pieces (self, ctx)
 
def get_error_hint (self, ctx)
 
def add_to_parser (self, parser, ctx)
 
- Public Member Functions inherited from Parameter
def __init__ (self, param_decls=None, type=None, required=False, default=None, callback=None, nargs=None, metavar=None, expose_value=True, is_eager=False, envvar=None, autocompletion=None)
 
def __repr__ (self)
 
def get_default (self, ctx)
 
def consume_value (self, ctx, opts)
 
def type_cast_value (self, ctx, value)
 
def process_value (self, ctx, value)
 
def value_is_missing (self, value)
 
def full_process_value (self, ctx, value)
 
def resolve_envvar_value (self, ctx)
 
def value_from_envvar (self, ctx)
 
def handle_parse_result (self, ctx, opts, args)
 
def get_help_record (self, ctx)
 

Static Public Attributes

string param_type_name = "argument"
 
- Static Public Attributes inherited from Parameter
string param_type_name = "parameter"
 

Additional Inherited Members

- Data Fields inherited from Parameter
 secondary_opts
 
 type
 
 required
 
 callback
 
 nargs
 
 multiple
 
 expose_value
 
 default
 
 is_eager
 
 metavar
 
 envvar
 
 autocompletion
 

Detailed Description

Arguments are positional parameters to a command.  They generally
provide fewer features than options but can have infinite ``nargs``
and are required by default.

All parameters are passed onwards to the parameter constructor.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  param_decls,
  required = None,
**  attrs 
)

Member Function Documentation

◆ add_to_parser()

def add_to_parser (   self,
  parser,
  ctx 
)

Reimplemented from Parameter.

◆ get_error_hint()

def get_error_hint (   self,
  ctx 
)
Get a stringified version of the param for use in error messages to
indicate which param caused the error.

Reimplemented from Parameter.

◆ get_usage_pieces()

def get_usage_pieces (   self,
  ctx 
)

Reimplemented from Parameter.

◆ human_readable_name()

def human_readable_name (   self)
Returns the human readable name of this parameter.  This is the
same as the name for options, but the metavar for arguments.

Reimplemented from Parameter.

◆ make_metavar()

def make_metavar (   self)

Reimplemented from Parameter.

Field Documentation

◆ param_type_name

string param_type_name = "argument"
static

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