本文整理汇总了Python中WMCore.RequestManager.RequestDB.Interface.Request.ListRequests类的典型用法代码示例。如果您正苦于以下问题:Python ListRequests类的具体用法?Python ListRequests怎么用?Python ListRequests使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ListRequests类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: findRequest
def findRequest(self, requestName):
""" Either returns the request object, or None """
requests = ListRequests.listRequests()
for request in requests:
if request['RequestName'] == requestName:
return request
return None
示例2: requestsWithStatus
def requestsWithStatus(status):
requestIds = theseIds = ListRequests.listRequestsByStatus(status).values()
requests = []
for requestId in requestIds:
request = GetRequest.getRequest(requestId)
request = prepareForTable(request)
requests.append(request)
return requests
示例3: putAssignment
def putAssignment(self, team, requestName):
""" Assigns this request to this team """
# see if it's already assigned
team = urllib.unquote(team)
if not team in ProdManagement.listTeams():
raise cherrypy.HTTPError(404,"Cannot find this team")
requestNamesAndIDs = ListRequests.listRequestsByTeam(team)
if requestName in requestNamesAndIDs.keys():
raise cherrypy.HTTPError(400,"Already assigned to this team")
return ChangeState.assignRequest(requestName, team)
示例4: getRequests
def getRequests():
""" This only fills the details needed to make succint browser tables,
so some fields, such as InputDatasets or SoftwareVersions,
need to be filled through getRequestDetails """
requests = ListRequests.listRequests()
reverseTypes, reverseStatus = reverseLookups()
result = []
for request in requests:
result.append(getRequest(request['RequestID'], reverseTypes, reverseStatus))
return result
示例5: team
def team(self, teamName):
""" Details for a team """
self.validate(teamName)
assignments = ListRequests.listRequestsByTeam(teamName)
if assignments == None:
assignments = []
else:
assignments = assignments.keys()
self.validate(assignments)
return self.templatepage("Team", team=teamName, requests=assignments)
示例6: getAllRequestDetails
def getAllRequestDetails():
requests = ListRequests.listRequests()
result = []
for request in requests:
requestName = request['RequestName']
details = getRequestDetails(requestName)
# take out excessive information
del details['RequestUpdates']
del details['RequestMessages']
result.append(details)
return result
示例7: findAssignedRequests
def findAssignedRequests(prodMgr):
"""
_findAssignedRequests_
find a list of assigned state requests associated to the prodMgr
instance provided.
returns a list of request IDs
"""
pmReqs = ListRequests.listRequestsByProdMgr(prodMgr)
result = [ x["RequestID"] for x in pmReqs
if x['RequestStatus'] == "assigned" ]
return result
示例8: getAssignment
def getAssignment(self, teamName=None, request=None):
""" If a team name is passed in, get all assignments for that team.
If a request is passed in, return a list of teams the request is
assigned to
"""
# better to use ReqMgr/RequestDB/Interface/ProdSystem/ProdMgrRetrieve?
#requestIDs = ProdMgrRetrieve.findAssignedRequests(teamName)
# Maybe now assigned to team is same as assigned to ProdMgr
result = []
if teamName != None:
requestIDs = ListRequests.listRequestsByTeam(teamName, "assigned").values()
requests = [GetRequest.getRequest(reqID) for reqID in requestIDs]
# put highest priorities first
requests.sort(key=lambda r: r['RequestPriority'], reverse=True)
# return list of tuples, since we need sorting
result = [[req['RequestName'], req['RequestWorkflow']] for req in requests]
elif request != None:
result = GetRequest.getAssignmentsByName(request)
return result
示例9: getRequestsByStatusAndTeam
def getRequestsByStatusAndTeam(self, teamName, status):
""" Get a list of request names with the given team and status.
"""
requestNames = ListRequests.listRequestsByTeam(teamName, status).keys()
return requestNames