This method supports the same args as ArgumentParser.add_argument(..) as well as the additional args below. Arguments: include_in_web_ui: If True (default), the argument will show in the UI. is_secret: If True (default is False) and include_in_web_ui
(self, *args, **kwargs)
| 64 | self.exit(2, f"{self.prog}: error: {message}\n") |
| 65 | |
| 66 | def add_argument(self, *args, **kwargs) -> configargparse.Action: |
| 67 | """ |
| 68 | This method supports the same args as ArgumentParser.add_argument(..) |
| 69 | as well as the additional args below. |
| 70 | |
| 71 | Arguments: |
| 72 | include_in_web_ui: If True (default), the argument will show in the UI. |
| 73 | is_secret: If True (default is False) and include_in_web_ui is True, the argument will show in the UI with a password masked text input. |
| 74 | is_required: If True (default is False) and include_in_web_ui is True, the argument will show in the UI as a required form field. |
| 75 | is_multiple: If True (default is False) and include_in_web_ui is True, the argument will show in the UI as a multiple select form field. |
| 76 | |
| 77 | Returns: |
| 78 | argparse.Action: the new argparse action |
| 79 | """ |
| 80 | include_in_web_ui = kwargs.pop("include_in_web_ui", True) |
| 81 | is_secret = kwargs.pop("is_secret", False) |
| 82 | is_required = kwargs.pop("is_required", False) |
| 83 | is_multiple = kwargs.pop("is_multiple", False) |
| 84 | action = super().add_argument(*args, **kwargs) |
| 85 | action.include_in_web_ui = include_in_web_ui |
| 86 | action.is_secret = is_secret |
| 87 | action.is_required = is_required |
| 88 | action.is_multiple = is_multiple |
| 89 | return action |
| 90 | |
| 91 | @property |
| 92 | def args_included_in_web_ui(self) -> dict[str, configargparse.Action]: |
no outgoing calls