本文整理汇总了Python中pyral.Rally.getAllUsers方法的典型用法代码示例。如果您正苦于以下问题:Python Rally.getAllUsers方法的具体用法?Python Rally.getAllUsers怎么用?Python Rally.getAllUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyral.Rally
的用法示例。
在下文中一共展示了Rally.getAllUsers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_all_users_query
# 需要导入模块: from pyral import Rally [as 别名]
# 或者: from pyral.Rally import getAllUsers [as 别名]
def test_all_users_query():
"""
Using a known valid Rally server and known valid access credentials,
request information about every user associated with the current subscription.
"""
rally = Rally(server=PREVIEW, user=PREVIEW_USER, password=PREVIEW_PSWD)
everybody = rally.getAllUsers()
assert len(everybody) > 0
assert len([user for user in everybody if user.DisplayName == 'Sara']) == 1
示例2: dict
# 需要导入模块: from pyral import Rally [as 别名]
# 或者: from pyral.Rally import getAllUsers [as 别名]
DEBUG_OUTPUT = True
TRELLO_ID = ""
TRELLO_USER = ""
TRELLO_TOKEN = ""
TRELLO_BOARD = ""
TRELLO_LIST = ""
trelloApi = trello.TrelloApi(TRELLO_ID)
trelloApi.set_token(TRELLO_TOKEN)
boards = trello.Members(TRELLO_ID, TRELLO_TOKEN).get_board(TRELLO_USER)
testBoard = [board for board in boards if board['name'] == TRELLO_BOARD][0]
boardList = [list for list in trello.Boards(TRELLO_ID, TRELLO_TOKEN).get_list(testBoard['id']) if list['name'] == TRELLO_LIST][0]
#############
#Username (trello) <-- Full Name --> E-mail (rally)
emailList = dict()
all_users = rally.getAllUsers()
for user in all_users:
rallyName = ("{} {}".format(user.FirstName, user.LastName)).lower()
emailList[rallyName] = user.EmailAddress
boardMembers = trello.Boards(TRELLO_ID, TRELLO_TOKEN).get_member(testBoard['id'])
emailToUserName = dict()
for member in boardMembers:
trelloName = ("{}".format(member['fullName'])).lower()
emailToUserName[member['username']] = emailList[trelloName]
for user in emailToUserName:
print user
################################