本文整理汇总了Python中WMCore.RequestManager.RequestDB.Interface.Group.Information类的典型用法代码示例。如果您正苦于以下问题:Python Information类的具体用法?Python Information怎么用?Python Information使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Information类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getGroup
def getGroup(self, group=None, user=None):
""" No args lists all groups, one args returns JSON with users."""
if group != None:
result = {}
result['users'] = GroupInfo.usersInGroup(group)
return result
elif user != None:
return GroupInfo.groupsForUser(user).keys()
else:
return GroupInfo.listGroups()
示例2: user
def user(self, userName):
""" Web page of details about the user. """
self.validate(userName)
groups = GroupInfo.groupsForUser(userName).keys()
requests = UserRequests.listRequests(userName).keys()
allGroups = GroupInfo.listGroups()
self.validate(groups)
self.validate(requests)
self.validate(allGroups)
return self.templatepage("User", user=userName, groups=groups,
allGroups=allGroups, requests=requests)
示例3: getGroup
def getGroup(self, group=None, user=None):
""" No args lists all groups, one args returns JSON with users and priority """
if group != None:
result = {}
result['users'] = GroupInfo.usersInGroup(group)
result['priority'] = GroupManagement.getPriority(group)
return json.dumps(result)
elif user != None:
return GroupInfo.groupsForUser(user).keys()
else:
return GroupInfo.listGroups()
示例4: user
def user(self, userName):
""" Web page of details about the user, and sets user priority """
self.validate(userName)
groups = GroupInfo.groupsForUser(userName).keys()
requests = UserRequests.listRequests(userName).keys()
priority = UserManagement.getPriority(userName)
allGroups = GroupInfo.listGroups()
self.validate(groups)
self.validate(requests)
self.validate(allGroups)
return self.templatepage("User", user=userName, groups=groups,
allGroups=allGroups, requests=requests, priority=priority)
示例5: getUser
def getUser(self, userName = None, group = None):
""" No args returns a list of all users. Group returns groups this user is in. Username
returs a JSON with information about the user """
if userName != None:
if not Registration.isRegistered(userName):
raise cherrypy.HTTPError(404, "Cannot find user")
result = {}
result['groups'] = GroupInfo.groupsForUser(userName).keys()
result['requests'] = UserRequests.listRequests(userName).keys()
result.update(Registration.userInfo(userName))
return result
elif group != None:
GroupInfo.usersInGroup(group)
else:
return Registration.listUsers()
示例6: putGroup
def putGroup(self, group, user=None):
""" Creates a group, or if a user is passed, adds that user to the group """
if(user != None):
# assume group exists and add user to it
return GroupManagement.addUserToGroup(user, group)
if GroupInfo.groupExists(group):
return "Group already exists"
GroupManagement.addGroup(group)
示例7: deleteUser
def deleteUser(self, user):
""" Deletes a user, as well as deleting his requests and removing
him from all groups """
if user in self.getUser():
requests = json.loads(self.getUser(user))['requests']
for request in requests:
self.deleteRequest(request)
for group in GroupInfo.groupsForUser(user).keys():
GroupManagement.removeUserFromGroup(user, group)
return UserManagement.deleteUser(user)
示例8: group
def group(self, groupName):
""" Web page of details about the group."""
self.validate(groupName)
users = GroupInfo.usersInGroup(groupName)
return self.templatepage("Group", group=groupName, users=users)
示例9: groups
def groups(self):
""" Lists all users. Should be paginated later """
allGroups = GroupInfo.listGroups()
self.validate(allGroups)
return self.templatepage("Groups", groups=allGroups)
示例10: group
def group(self, groupName):
""" Web page of details about the user, and sets user priority """
self.validate(groupName)
users = GroupInfo.usersInGroup(groupName)
priority = GroupManagement.getPriority(groupName)
return self.templatepage("Group", group=groupName, users=users, priority=priority)