def getGroups(self): response, content = self._req('GET', '/admin/group') xml = minidom.parseString(content) return [ youtrack.Group(e, self) for e in xml.documentElement.childNodes if e.nodeType == Node.ELEMENT_NODE ]
def getUserGroups(self, userName): response, content = self._req( 'GET', '/admin/user/%s/group' % urlquote(userName.encode('utf-8'))) xml = minidom.parseString(content) return [ youtrack.Group(e, self) for e in xml.documentElement.childNodes if e.nodeType == Node.ELEMENT_NODE ]
def getProjectAssigneeGroups(self, projectId): response, content = self._req( 'GET', '/admin/project/' + urlquote(projectId) + '/assignee/group') xml = minidom.parseString(content) return [ youtrack.Group(e, self) for e in xml.documentElement.childNodes if e.nodeType == Node.ELEMENT_NODE ]
def _to_yt_group(self, redmine_group, users=None): if not isinstance(redmine_group, basestring): redmine_group = redmine_group.name if redmine_group not in self._groups: group = youtrack.Group() group.name = redmine_group if users is None: users = [] group.users = users self._groups[redmine_group] = group return self._groups[redmine_group]
def getGroup(self, name): return youtrack.Group(self._get("/admin/group/" + urlquote(name.encode('utf-8'))), self)