예제 #1
0
    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
예제 #2
0
    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
예제 #3
0
 def repo_collector(repo):
     if repo.pushed_at < recent_than:
         return
     parallel_foreach(collect_commits, repo.branches)
예제 #4
0
 def repo_collector(repo):
     if repo.pushed_at < recent_than:
         return
     parallel_foreach(collect_commits, repo.branches)