(action, argument_strings, option_string=None)
| 2181 | warned = set() |
| 2182 | |
| 2183 | def take_action(action, argument_strings, option_string=None): |
| 2184 | seen_actions.add(action) |
| 2185 | argument_values = self._get_values(action, argument_strings) |
| 2186 | |
| 2187 | # error if this argument is not allowed with other previously |
| 2188 | # seen arguments |
| 2189 | if action.option_strings or argument_strings: |
| 2190 | seen_non_default_actions.add(action) |
| 2191 | for conflict_action in action_conflicts.get(action, []): |
| 2192 | if conflict_action in seen_non_default_actions: |
| 2193 | msg = _('not allowed with argument %s') |
| 2194 | action_name = _get_action_name(conflict_action) |
| 2195 | raise ArgumentError(action, msg % action_name) |
| 2196 | |
| 2197 | # take the action if we didn't receive a SUPPRESS value |
| 2198 | # (e.g. from a default) |
| 2199 | if argument_values is not SUPPRESS: |
| 2200 | action(self, namespace, argument_values, option_string) |
| 2201 | |
| 2202 | # function to convert arg_strings into an optional action |
| 2203 | def consume_optional(start_index): |
nothing calls this directly
no test coverage detected