def get_latest_commits(self, recent_than=None): if not recent_than: recent_than = datetime.datetime.today() - \ datetime.timedelta(days=14) recent_than = recent_than.isoformat()[:10] all_commits = deque() is_recent = self.__make_commit_recency_checker(recent_than) def collect_commits(branch): all_commits.extend(commit for commit in takewhile(is_recent, branch.commits) if (commit.author and commit.author['login'] or commit.committer and commit.committer['login']) == self.login) def repo_collector(repo): if repo.pushed_at < recent_than: return parallel_foreach(collect_commits, repo.branches) parallel_foreach(repo_collector, self.repos) return all_commits
def repo_collector(repo): if repo.pushed_at < recent_than: return parallel_foreach(collect_commits, repo.branches)