def get_all_authors(github_repo: Repository) -> str: authors = github_repo.get_contributors() # Sort alphabetically by name or login if no name is present authors = sorted(authors, key=lambda author: str.lower(author.login) if author.name is None else str.lower(author.name)) author_list = "" for author in authors: if author.name is None: author_list += "- " + author.login + "\n" else: author_list += "- " + author.name + " (" + author.login + ")\n" return author_list
def members_repository(repo: Repository.Repository): while True: try: contributors_login_list: set = set() member: PaginatedList.PaginatedList = repo.get_contributors() for person in member: contributors_login_list.add(person) return contributors_login_list except TypeError: return set() except GithubException: pass except exceptions.RequestException: pass
def get_all_authors(github_repo: Repository) -> str: authors = github_repo.get_contributors() # Sort alphabetically by name or login if no name is present authors = sorted(authors, key=lambda author: str.lower(author.login) if author.name is None else str.lower(author.name)) author_list = "" for author in authors: # Filter the MRTK 🤖 from the list if author.login == "mrtk-bld" or "[bot]" in author.login: continue if author.name is None: author_list += "- " + author.login + "\n" else: author_list += "- " + author.name + " (" + author.login + ")\n" return author_list