scripts/github_stats.py
def get_issues(self, repo, organization='llnl'):
        """
        Retrieves the number of closed issues.
        """
        #JSON
        path = ('../github-data/' + organization + '/' + repo.name + '/issues')
        is_only_today = False
        if not os.path.exists(path): #no previous path, get all issues
            all_issues = repo.iter_issues(state='all')
            is_only_today = True
        else:
            files = os.listdir(path)
            date = str(files[-1][:-5])
            if date == str(datetime.date.today()):
                #most recent date is actually today, get previous most recent date
                if len(files) > 2:
                    date = str(files[-2][:-5])
                else:
                    #This means there is only one file, today. Retrieve every issue
                    all_issues = repo.iter_issues(state='all')
                    is_only_today = True
            if not is_only_today:#there's a previous saved JSON that's not today
                all_issues = repo.iter_issues(since=date, state='all')
        for issue in all_issues:
            self.issues_json[repo.name].append(issue.to_json())
        #CSV
        closed_issues = 0
        for issue in repo.iter_issues(state='closed'):
            if issue is not None:
                closed_issues += 1
        return closed_issues
def get_issues(self, repo, organization='llnl'):
        """
        Retrieves the number of closed issues.
        """
        #JSON
        path = ('../github-data/' + organization + '/' + repo.name + '/issues')
        is_only_today = False
        if not os.path.exists(path): #no previous path, get all issues
            all_issues = repo.iter_issues(state='all')
            is_only_today = True
        else:
            files = os.listdir(path)
            date = str(files[-1][:-5])
            if date == str(datetime.date.today()):
                #most recent date is actually today, get previous most recent date
                if len(files) > 2:
                    date = str(files[-2][:-5])
                else:
                    #This means there is only one file, today. Retrieve every issue
                    all_issues = repo.iter_issues(state='all')
                    is_only_today = True
            if not is_only_today:#there's a previous saved JSON that's not today
                all_issues = repo.iter_issues(since=date, state='all')
        for issue in all_issues:
            self.issues_json[repo.name].append(issue.to_json())
        #CSV
        closed_issues = 0
        for issue in repo.iter_issues(state='closed'):
            if issue is not None:
                closed_issues += 1
        return closed_issues
Retrieves the number of closed issues.