(self, action)
| 1645 | return group |
| 1646 | |
| 1647 | def _add_action(self, action): |
| 1648 | # resolve any conflicts |
| 1649 | self._check_conflict(action) |
| 1650 | |
| 1651 | # add to actions list |
| 1652 | self._actions.append(action) |
| 1653 | action.container = self |
| 1654 | |
| 1655 | # index the action by any option strings it has |
| 1656 | for option_string in action.option_strings: |
| 1657 | self._option_string_actions[option_string] = action |
| 1658 | |
| 1659 | # set the flag if any option strings look like negative numbers |
| 1660 | for option_string in action.option_strings: |
| 1661 | if self._negative_number_matcher.match(option_string): |
| 1662 | if not self._has_negative_number_optionals: |
| 1663 | self._has_negative_number_optionals.append(True) |
| 1664 | |
| 1665 | # return the created action |
| 1666 | return action |
| 1667 | |
| 1668 | def _remove_action(self, action): |
| 1669 | self._actions.remove(action) |
no test coverage detected