scripts/github_stats.py
def write_totals(self, file_path='', date=str(datetime.date.today()),
        organization='N/A', members=0, teams=0):
        """
        Updates the total.csv file with current data.
        """

        total_exists = os.path.isfile(file_path)
        with open(file_path, 'a') as out_total:
            if not total_exists:
                out_total.write('date,organization,repos,members,teams,'
                    + 'unique_contributors,total_contributors,forks,'
                    + 'stargazers,pull_requests,open_issues,has_readme,'
                    + 'has_license,pull_requests_open,pull_requests_closed,'
                    + 'commits,id,closed_issues,issues\n')
            self.delete_last_line(date=date, file_path=file_path)
        out_total.close()
        with open(file_path, 'r') as file_read:
            row_count = sum(1 for row in file_read) - 1
        file_read.close()
        with open(file_path, 'a') as out_total:
            out_total.write(date + ',' + organization + ','
                + str(self.total_repos) + ',' + str(members) + ',' + str(teams)
                + ',' + str(len(self.unique_contributors)) + ','
                + str(self.total_contributors) + ',' + str(self.total_forks)
                + ',' + str(self.total_stars) + ',' + str(self.total_pull_reqs)
                + ',' + str(self.total_open_issues) + ','
                + str(self.total_readmes) + ',' + str(self.total_licenses) + ','
                + str(self.total_pull_reqs_open) + ','
                + str(self.total_pull_reqs_closed) + ','
                + str(self.total_commits) + ',' + str(row_count) + ','
                + str(self.total_closed_issues) + ',' + str(self.total_issues)
                + '\n')
        out_total.close()
def write_totals(self, file_path='', date=str(datetime.date.today()),
        organization='N/A', members=0, teams=0):
        total_exists = os.path.isfile(file_path)
        with open(file_path, 'a') as out_total:
            if not total_exists:
                out_total.write('date,organization,repos,members,teams,'
                    + 'unique_contributors,total_contributors,forks,'
                    + 'stargazers,pull_requests,open_issues,has_readme,'
                    + 'has_license,pull_requests_open,pull_requests_closed,'
                    + 'commits,id,closed_issues,issues\n')
            self.delete_last_line(date=date, file_path=file_path)
        out_total.close()
        with open(file_path, 'r') as file_read:
            row_count = sum(1 for row in file_read) - 1
        file_read.close()
        with open(file_path, 'a') as out_total:
            out_total.write(date + ',' + organization + ','
                + str(self.total_repos) + ',' + str(members) + ',' + str(teams)
                + ',' + str(len(self.unique_contributors)) + ','
                + str(self.total_contributors) + ',' + str(self.total_forks)
                + ',' + str(self.total_stars) + ',' + str(self.total_pull_reqs)
                + ',' + str(self.total_open_issues) + ','
                + str(self.total_readmes) + ',' + str(self.total_licenses) + ','
                + str(self.total_pull_reqs_open) + ','
                + str(self.total_pull_reqs_closed) + ','
                + str(self.total_commits) + ',' + str(row_count) + ','
                + str(self.total_closed_issues) + ',' + str(self.total_issues)
                + '\n')
        out_total.close()
def write_totals ( self , file_path = '' , date = str ( datetime . date . today ( ) ) , organization = 'N/A' , members = 0 , teams = 0 ) : total_exists = os . path . isfile ( file_path ) with open ( file_path , 'a' ) as out_total : if not total_exists : out_total . write ( 'date,organization,repos,members,teams,' + 'unique_contributors,total_contributors,forks,' + 'stargazers,pull_requests,open_issues,has_readme,' + 'has_license,pull_requests_open,pull_requests_closed,' + 'commits,id,closed_issues,issues\n' ) self . delete_last_line ( date = date , file_path = file_path ) out_total . close ( ) with open ( file_path , 'r' ) as file_read : row_count = sum ( 1 for row in file_read ) - 1 file_read . close ( ) with open ( file_path , 'a' ) as out_total : out_total . write ( date + ',' + organization + ',' + str ( self . total_repos ) + ',' + str ( members ) + ',' + str ( teams ) + ',' + str ( len ( self . unique_contributors ) ) + ',' + str ( self . total_contributors ) + ',' + str ( self . total_forks ) + ',' + str ( self . total_stars ) + ',' + str ( self . total_pull_reqs ) + ',' + str ( self . total_open_issues ) + ',' + str ( self . total_readmes ) + ',' + str ( self . total_licenses ) + ',' + str ( self . total_pull_reqs_open ) + ',' + str ( self . total_pull_reqs_closed ) + ',' + str ( self . total_commits ) + ',' + str ( row_count ) + ',' + str ( self . total_closed_issues ) + ',' + str ( self . total_issues ) + '\n' ) out_total . close ( )
Updates the total.csv file with current data.
Updates the total . csv file with current data .