MCPcopy Create free account
hub / github.com/apache/madlib / _MutuallyExclusiveGroup

Class _MutuallyExclusiveGroup

src/madpack/argparse.py:1525–1542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1523
1524
1525class _MutuallyExclusiveGroup(_ArgumentGroup):
1526
1527 def __init__(self, container, required=False):
1528 super(_MutuallyExclusiveGroup, self).__init__(container)
1529 self.required = required
1530 self._container = container
1531
1532 def _add_action(self, action):
1533 if action.required:
1534 msg = _('mutually exclusive arguments must be optional')
1535 raise ValueError(msg)
1536 action = self._container._add_action(action)
1537 self._group_actions.append(action)
1538 return action
1539
1540 def _remove_action(self, action):
1541 self._container._remove_action(action)
1542 self._group_actions.remove(action)
1543
1544
1545class ArgumentParser(_AttributeHolder, _ActionsContainer):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected