MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / add_group

Method add_group

tests/utils/api_client.py:683–695  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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, ...)."""

Calls 2

commandMethod · 0.95
list_groupsMethod · 0.95