(action, argument_strings, option_string=None)
| 1796 | seen_non_default_actions = set() |
| 1797 | |
| 1798 | def take_action(action, argument_strings, option_string=None): |
| 1799 | seen_actions.add(action) |
| 1800 | argument_values = self._get_values(action, argument_strings) |
| 1801 | |
| 1802 | # error if this argument is not allowed with other previously |
| 1803 | # seen arguments, assuming that actions that use the default |
| 1804 | # value don't really count as "present" |
| 1805 | if argument_values is not action.default: |
| 1806 | seen_non_default_actions.add(action) |
| 1807 | for conflict_action in action_conflicts.get(action, []): |
| 1808 | if conflict_action in seen_non_default_actions: |
| 1809 | msg = _('not allowed with argument %s') |
| 1810 | action_name = _get_action_name(conflict_action) |
| 1811 | raise ArgumentError(action, msg % action_name) |
| 1812 | |
| 1813 | # take the action if we didn't receive a SUPPRESS value |
| 1814 | # (e.g. from a default) |
| 1815 | if argument_values is not SUPPRESS: |
| 1816 | action(self, namespace, argument_values, option_string) |
| 1817 | |
| 1818 | # function to convert arg_strings into an optional action |
| 1819 | def consume_optional(start_index): |
nothing calls this directly
no test coverage detected