(action, argument_strings, option_string=None)
| 2099 | warned = set() |
| 2100 | |
| 2101 | def take_action(action, argument_strings, option_string=None): |
| 2102 | seen_actions.add(action) |
| 2103 | argument_values = self._get_values(action, argument_strings) |
| 2104 | |
| 2105 | # error if this argument is not allowed with other previously |
| 2106 | # seen arguments |
| 2107 | if action.option_strings or argument_strings: |
| 2108 | seen_non_default_actions.add(action) |
| 2109 | for conflict_action in action_conflicts.get(action, []): |
| 2110 | if conflict_action in seen_non_default_actions: |
| 2111 | msg = _('not allowed with argument %s') |
| 2112 | action_name = _get_action_name(conflict_action) |
| 2113 | raise ArgumentError(action, msg % action_name) |
| 2114 | |
| 2115 | # take the action if we didn't receive a SUPPRESS value |
| 2116 | # (e.g. from a default) |
| 2117 | if argument_values is not SUPPRESS: |
| 2118 | action(self, namespace, argument_values, option_string) |
| 2119 | |
| 2120 | # function to convert arg_strings into an optional action |
| 2121 | def consume_optional(start_index): |
nothing calls this directly
no test coverage detected