当前位置: 首页>>代码示例>>Python>>正文


Python Group.Information类代码示例

本文整理汇总了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()
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:10,代码来源:ReqMgrRESTModel.py

示例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)
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:11,代码来源:Admin.py

示例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()
开发者ID:zhiwenuil,项目名称:WMCore,代码行数:11,代码来源:ReqMgrRESTModel.py

示例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)
开发者ID:stuartw,项目名称:WMCore,代码行数:12,代码来源:Admin.py

示例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()
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:15,代码来源:ReqMgrRESTModel.py

示例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)
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:8,代码来源:ReqMgrRESTModel.py

示例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)
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:10,代码来源:ReqMgrRESTModel.py

示例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)
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:5,代码来源:Admin.py

示例9: groups

 def groups(self):
     """ Lists all users.  Should be paginated later """
     allGroups = GroupInfo.listGroups()
     self.validate(allGroups)
     return self.templatepage("Groups", groups=allGroups)
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:5,代码来源:Admin.py

示例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)
开发者ID:stuartw,项目名称:WMCore,代码行数:6,代码来源:Admin.py


注:本文中的WMCore.RequestManager.RequestDB.Interface.Group.Information类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。