INNER CODE UNIT · Python
get_missing_message
braedon/prometheus-es-exporter · prometheus_es_exporter/__init__.py:279
def get_missing_message(self, param):
return 'Choose one or more from:\n\t%s.' % ',\n\t'.join(self.choices)
def convert_one(self, value, param, ctx):
# Exact match
if value in self.choices:
return value
# Match through normalization and case sensitivity
# first do token_normalize_func, then lowercase
# preserve original `value` to produce an accurate message in
# `self.fail`
normed_value = value
normed_choices = self.choices
if ctx is not None and \
ctx.token_normalize_func is not None:
normed_value = ctx.token_normalize_func(value)