(self, action)
| 1569 | return group |
| 1570 | |
| 1571 | def _add_action(self, action): |
| 1572 | # resolve any conflicts |
| 1573 | self._check_conflict(action) |
| 1574 | |
| 1575 | # add to actions list |
| 1576 | self._actions.append(action) |
| 1577 | action.container = self |
| 1578 | |
| 1579 | # index the action by any option strings it has |
| 1580 | for option_string in action.option_strings: |
| 1581 | self._option_string_actions[option_string] = action |
| 1582 | |
| 1583 | # set the flag if any option strings look like negative numbers |
| 1584 | for option_string in action.option_strings: |
| 1585 | if self._negative_number_matcher.match(option_string): |
| 1586 | if not self._has_negative_number_optionals: |
| 1587 | self._has_negative_number_optionals.append(True) |
| 1588 | |
| 1589 | # return the created action |
| 1590 | return action |
| 1591 | |
| 1592 | def _remove_action(self, action): |
| 1593 | self._actions.remove(action) |
no test coverage detected