(
self,
parser: argparse.ArgumentParser,
namespace: argparse.Namespace,
values: object,
option_string: str | None = None,
)
| 46 | """ |
| 47 | |
| 48 | def __call__( |
| 49 | self, |
| 50 | parser: argparse.ArgumentParser, |
| 51 | namespace: argparse.Namespace, |
| 52 | values: object, |
| 53 | option_string: str | None = None, |
| 54 | ) -> None: |
| 55 | if not isinstance(values, str): |
| 56 | return |
| 57 | |
| 58 | key, sep, value = values.partition("=") |
| 59 | if not key or not sep: |
| 60 | raise InvalidCommandArgumentError( |
| 61 | f"Option {option_string} expect a key=value format" |
| 62 | ) |
| 63 | kwargs = getattr(namespace, self.dest, None) or {} |
| 64 | kwargs[key] = value.strip("'\"") |
| 65 | setattr(namespace, self.dest, kwargs) |
| 66 | |
| 67 | |
| 68 | tpl_arguments = ( |
nothing calls this directly
no test coverage detected