perceval/backends/core/github.py
def __fetch_pull_requests(self, from_date, to_date):
        """Fetch the pull requests"""

        raw_pulls = self.client.pulls(from_date=from_date)
        for raw_pull in raw_pulls:
            pull = json.loads(raw_pull)

            if str_to_datetime(pull['updated_at']) > to_date:
                return

            self.__init_extra_pull_fields(pull)
            for field in TARGET_PULL_FIELDS:

                if not pull[field]:
                    continue

                if field == 'user':
                    pull[field + '_data'] = self.__get_user(pull[field]['login'])
                elif field == 'merged_by':
                    pull[field + '_data'] = self.__get_user(pull[field]['login'])
                elif field == 'review_comments':
                    pull[field + '_data'] = self.__get_pull_review_comments(pull['number'])
                elif field == 'requested_reviewers':
                    pull[field + '_data'] = self.__get_pull_requested_reviewers(pull['number'])
                elif field == 'commits':
                    pull[field + '_data'] = self.__get_pull_commits(pull['number'])

            yield pull
def __fetch_pull_requests(self, from_date, to_date):
        raw_pulls = self.client.pulls(from_date=from_date)
        for raw_pull in raw_pulls:
            pull = json.loads(raw_pull)

            if str_to_datetime(pull['updated_at']) > to_date:
                return

            self.__init_extra_pull_fields(pull)
            for field in TARGET_PULL_FIELDS:

                if not pull[field]:
                    continue

                if field == 'user':
                    pull[field + '_data'] = self.__get_user(pull[field]['login'])
                elif field == 'merged_by':
                    pull[field + '_data'] = self.__get_user(pull[field]['login'])
                elif field == 'review_comments':
                    pull[field + '_data'] = self.__get_pull_review_comments(pull['number'])
                elif field == 'requested_reviewers':
                    pull[field + '_data'] = self.__get_pull_requested_reviewers(pull['number'])
                elif field == 'commits':
                    pull[field + '_data'] = self.__get_pull_commits(pull['number'])

            yield pull
def __fetch_pull_requests ( self , from_date , to_date ) : raw_pulls = self . client . pulls ( from_date = from_date ) for raw_pull in raw_pulls : pull = json . loads ( raw_pull ) if str_to_datetime ( pull [ 'updated_at' ] ) > to_date : return self . __init_extra_pull_fields ( pull ) for field in TARGET_PULL_FIELDS : if not pull [ field ] : continue if field == 'user' : pull [ field + '_data' ] = self . __get_user ( pull [ field ] [ 'login' ] ) elif field == 'merged_by' : pull [ field + '_data' ] = self . __get_user ( pull [ field ] [ 'login' ] ) elif field == 'review_comments' : pull [ field + '_data' ] = self . __get_pull_review_comments ( pull [ 'number' ] ) elif field == 'requested_reviewers' : pull [ field + '_data' ] = self . __get_pull_requested_reviewers ( pull [ 'number' ] ) elif field == 'commits' : pull [ field + '_data' ] = self . __get_pull_commits ( pull [ 'number' ] ) yield pull
Fetch the pull requests
Fetch the pull requests