Add a group and return its positional groupId. project.group.add doesn't echo the new id; the positional groupId is the last array index in project.group.list. Use this with the project.group.* (positional) handlers. For uniqueId-based handlers (workspace re
(self, title: str = "Group", widget_type: int = 0)
| 681 | return self.command("project.action.list").get("actions", []) |
| 682 | |
| 683 | def add_group(self, title: str = "Group", widget_type: int = 0) -> int: |
| 684 | """ |
| 685 | Add a group and return its positional groupId. |
| 686 | |
| 687 | project.group.add doesn't echo the new id; the positional groupId is |
| 688 | the last array index in project.group.list. Use this with the |
| 689 | project.group.* (positional) handlers. For uniqueId-based handlers |
| 690 | (workspace refs, dataset.xAxisId, ...) read `uniqueId` from |
| 691 | project.group.list yourself. |
| 692 | """ |
| 693 | self.command("project.group.add", {"title": title, "widgetType": widget_type}) |
| 694 | groups = self.list_groups() |
| 695 | return len(groups) - 1 if groups else -1 |
| 696 | |
| 697 | def update_group(self, group_id: int, **fields) -> dict: |
| 698 | """PATCH a group (title, widget, columns, sourceId, painterCode, ...).""" |