from argparse import Action from .key import Key __all__ = ["KeyAction"] class KeyAction(Action): def __call__(self, parser, namespace, values, option_string=None): setattr(namespace, self.dest, Key.from_string(values[0]))