(action, argument_strings, option_string=None)
| 1963 | seen_non_default_actions = set() |
| 1964 | |
| 1965 | def take_action(action, argument_strings, option_string=None): |
| 1966 | seen_actions.add(action) |
| 1967 | argument_values = self._get_values(action, argument_strings) |
| 1968 | |
| 1969 | # error if this argument is not allowed with other previously |
| 1970 | # seen arguments, assuming that actions that use the default |
| 1971 | # value don't really count as "present" |
| 1972 | if argument_values is not action.default: |
| 1973 | seen_non_default_actions.add(action) |
| 1974 | for conflict_action in action_conflicts.get(action, []): |
| 1975 | if conflict_action in seen_non_default_actions: |
| 1976 | msg = _('not allowed with argument %s') |
| 1977 | action_name = _get_action_name(conflict_action) |
| 1978 | raise ArgumentError(action, msg % action_name) |
| 1979 | |
| 1980 | # take the action if we didn't receive a SUPPRESS value |
| 1981 | # (e.g. from a default) |
| 1982 | if argument_values is not SUPPRESS: |
| 1983 | action(self, namespace, argument_values, option_string) |
| 1984 | |
| 1985 | # function to convert arg_strings into an optional action |
| 1986 | def consume_optional(start_index): |
nothing calls this directly
no test coverage detected