Lines Matching refs:group
394 # find group indices and identify actions in groups
397 for group in groups:
398 if not group._group_actions:
399 raise ValueError(f'empty group {group}')
402 start = actions.index(group._group_actions[0])
406 group_action_count = len(group._group_actions)
408 if actions[start:end] == group._group_actions:
411 for action in group._group_actions:
418 if not group.required:
457 # if it's in a group, strip the outer []
481 # make it look optional if it's not required or in a group
1471 group = _ArgumentGroup(self, *args, **kwargs)
1472 self._action_groups.append(group)
1473 return group
1476 group = _MutuallyExclusiveGroup(self, **kwargs)
1477 self._mutually_exclusive_groups.append(group)
1478 return group
1507 for group in self._action_groups:
1508 if group.title in title_group_map:
1510 raise ValueError(msg % (group.title))
1511 title_group_map[group.title] = group
1513 # map each action to its group
1515 for group in container._action_groups:
1517 # if a group with the title exists, use that, otherwise
1518 # create a new group matching the container's group
1519 if group.title not in title_group_map:
1520 title_group_map[group.title] = self.add_argument_group(
1521 title=group.title,
1522 description=group.description,
1523 conflict_handler=group.conflict_handler)
1525 # map the actions to their new group
1526 for action in group._group_actions:
1527 group_map[action] = title_group_map[group.title]
1532 for group in container._mutually_exclusive_groups:
1534 required=group.required)
1536 # map the actions to their new mutex group
1537 for action in group._group_actions:
1540 # add all actions to this container or their group
1656 # group attributes
2146 for group in self._mutually_exclusive_groups:
2147 if group.required:
2148 for action in group._group_actions:
2155 for action in group._group_actions
2211 return len(match.group(1))
2408 if [action.dest for group in self._mutually_exclusive_groups
2409 for action in group._group_actions if action in positionals]:
2447 for group in self._mutually_exclusive_groups:
2448 group.save_required = group.required
2449 group.required = False
2456 for group in self._mutually_exclusive_groups:
2457 group.required = group.save_required