def __init__(self, config): self.config = config self.app_key = self.config.get_app_key() self.app_token = self.config.get_app_token() self.board_id = self.config.get_boardid() self.trello = trello.TrelloApi(self.app_key) self.trello.set_token(self.app_token) self.trello_boards = trello.Boards(self.app_key, self.app_token) # We map Trello lists into Munki catalogs # # Each Munki Catalog will have multiple lists: # * a 'To' list # * Either: # * a list representing the munki catalog # * a dated set of lists representing the munki catalog # self.catalog_lists = None self.list_id_catalog = None self.trello_id_list = None self.trello_name_list = None self.cards = None # List ... currently
def getUserAndEmailList(rally, trelloID, trelloToken, trelloBoard): """Return a dict of Trello usernames to Rally/Trello e-mails using full name to link them [Username (trello) <-- Full Name (Both) --> E-mail (rally)] This is necessary because Trello users can only view their own e-mail addresses""" emailList = dict() all_users = rally.getAllUsers() #XXX This call crashes pyral 1.1.1 - Custom pyral changes are needed for user in all_users: rallyName = ("{} {}".format(user.FirstName, user.LastName)).lower() emailList[rallyName] = user.EmailAddress boardMembers = trello.Boards(trelloID, trelloToken).get_member(trelloBoard['id']) emailToUserName = dict() for member in boardMembers: trelloName = ("{}".format(member['fullName'])).lower() emailToUserName[member['username']] = emailList[trelloName] return emailToUserName
def getUserAndEmailList(): """Return a dict of Trello usernames to Rally/Trello e-mails using full name to link them [Username (trello) <-- Full Name (Both) --> E-mail (rally)] This is necessary because Trello users can only view their own e-mail addresses""" 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] return emailToUserName
def getTrelloListsForBoard(trelloID, trelloToken, trelloBoard): """Return all lists for the given Trello board""" lists = trello.Boards(trelloID, trelloToken).get_list(trelloBoard['id']) return lists