scripts/github_stats.py
def get_readme(self, repo):
        """
        Checks to see if the given repo has a ReadMe. MD means it has a correct
        Readme recognized by GitHub.
        """
        readme_contents = repo.readme()
        if readme_contents is not None:
            self.total_readmes += 1
            return 'MD'
        if self.search_limit >= 28:
            print 'Hit search limit. Sleeping for 60 sec.'
            time.sleep(60)
            self.search_limit = 0
        self.search_limit += 1
        search_results = self.logged_in_gh.search_code('readme'
            + 'in:path repo:' + repo.full_name)
        try:
            for result in search_results:
                path = result.path[1:]
                if '/' not in path and 'readme' in path.lower():
                    self.total_readmes += 1
                    return path
            return 'MISS'
        except (github3.models.GitHubError, StopIteration) as e:
            return 'MISS'
def get_readme(self, repo):
        """
        Checks to see if the given repo has a ReadMe. MD means it has a correct
        Readme recognized by GitHub.
        """
        readme_contents = repo.readme()
        if readme_contents is not None:
            self.total_readmes += 1
            return 'MD'
        if self.search_limit >= 28:
            print 'Hit search limit. Sleeping for 60 sec.'
            time.sleep(60)
            self.search_limit = 0
        self.search_limit += 1
        search_results = self.logged_in_gh.search_code('readme'
            + 'in:path repo:' + repo.full_name)
        try:
            for result in search_results:
                path = result.path[1:]
                if '/' not in path and 'readme' in path.lower():
                    self.total_readmes += 1
                    return path
            return 'MISS'
        except (github3.models.GitHubError, StopIteration) as e:
            return 'MISS'
def get_readme ( self , repo ) : readme_contents = repo . readme ( ) if readme_contents is not None : self . total_readmes += 1 return 'MD' if self . search_limit >= 28 : print 'Hit search limit. Sleeping for 60 sec.' time . sleep ( 60 ) self . search_limit = 0 self . search_limit += 1 search_results = self . logged_in_gh . search_code ( 'readme' + 'in:path repo:' + repo . full_name ) try : for result in search_results : path = result . path [ 1 : ] if '/' not in path and 'readme' in path . lower ( ) : self . total_readmes += 1 return path return 'MISS' except ( github3 . models . GitHubError , StopIteration ) as e : return 'MISS'
Checks to see if the given repo has a ReadMe. MD means it has a correct
        Readme recognized by GitHub.
Checks to see if the given repo has a ReadMe . MD means it has a correct Readme recognized by GitHub .