Belle II Software development
|
Public Member Functions | |
def | get_value (self, key, args, kwds) |
def | convert_field (self, value, conversion) |
def | format_field (self, value, format_spec) |
A string formatter that implements format most equivalent to the str.format, but does not replace keys, that are not present in the replacements dictionary Example ------- >>> formatter = TolerateMissingKeyFormatter() >>> template = "{present}_{missing}" >>> partially_substituted = formatter.format(template, present="replaced") >>> print partially_substituted "replaced_{missing}"
Definition at line 68 of file tolerate_missing_key_formatter.py.
def convert_field | ( | self, | |
value, | |||
conversion | |||
) |
Applies the conversion to the value. Overrides the standard method such that a potential conversion is attached to the NoReplacementField
Definition at line 99 of file tolerate_missing_key_formatter.py.
def format_field | ( | self, | |
value, | |||
format_spec | |||
) |
Applies the conversion to the value. Overrides the standard method such that a potential format_spec is attached to the NoReplacementField. Than composes the replacement_field specification to be inserted in the formatted string. The outcome should be equivalent to the unformatted string for missing keys.
Definition at line 112 of file tolerate_missing_key_formatter.py.
def get_value | ( | self, | |
key, | |||
args, | |||
kwds | |||
) |
Retrieves the value that corresponds to the key from either the positional or the keyword arguments given to format Overrides the standard lookup such that missing keys in the keyword arguments or transformed in a NoReplacementField signal object.
Definition at line 83 of file tolerate_missing_key_formatter.py.