scripts/get_year_commits.py
def get_year_commits(self, username='', password='', organization='llnl', force=True):
        """
        Does setup such as login, printing API info, and waiting for GitHub to
        build the commit statistics. Then gets the last year of commits and
        prints them to file.
        """
        date = str(datetime.date.today())
        file_path =  ('year_commits.csv')
        if force or not os.path.isfile(file_path):
            my_github.login(username, password)
            calls_beginning = self.logged_in_gh.ratelimit_remaining + 1
            print 'Rate Limit: ' + str(calls_beginning)
            my_github.get_org(organization)
            my_github.repos(building_stats=True)
            print "Letting GitHub build statistics."
            time.sleep(30)
            print "Trying again."
            my_github.repos(building_stats=False)
            my_github.calc_total_commits(starting_commits=35163)
            my_github.write_to_file()
            calls_remaining = self.logged_in_gh.ratelimit_remaining
            calls_used = calls_beginning - calls_remaining
            print ('Rate Limit Remaining: ' + str(calls_remaining) + '\nUsed '
                + str(calls_used) + ' API calls.')
def get_year_commits(self, username='', password='', organization='llnl', force=True):
        date = str(datetime.date.today())
        file_path =  ('year_commits.csv')
        if force or not os.path.isfile(file_path):
            my_github.login(username, password)
            calls_beginning = self.logged_in_gh.ratelimit_remaining + 1
            print 'Rate Limit: ' + str(calls_beginning)
            my_github.get_org(organization)
            my_github.repos(building_stats=True)
            print "Letting GitHub build statistics."
            time.sleep(30)
            print "Trying again."
            my_github.repos(building_stats=False)
            my_github.calc_total_commits(starting_commits=35163)
            my_github.write_to_file()
            calls_remaining = self.logged_in_gh.ratelimit_remaining
            calls_used = calls_beginning - calls_remaining
            print ('Rate Limit Remaining: ' + str(calls_remaining) + '\nUsed '
                + str(calls_used) + ' API calls.')
def get_year_commits ( self , username = '' , password = '' , organization = 'llnl' , force = True ) : date = str ( datetime . date . today ( ) ) file_path = ( 'year_commits.csv' ) if force or not os . path . isfile ( file_path ) : my_github . login ( username , password ) calls_beginning = self . logged_in_gh . ratelimit_remaining + 1 print 'Rate Limit: ' + str ( calls_beginning ) my_github . get_org ( organization ) my_github . repos ( building_stats = True ) print "Letting GitHub build statistics." time . sleep ( 30 ) print "Trying again." my_github . repos ( building_stats = False ) my_github . calc_total_commits ( starting_commits = 35163 ) my_github . write_to_file ( ) calls_remaining = self . logged_in_gh . ratelimit_remaining calls_used = calls_beginning - calls_remaining print ( 'Rate Limit Remaining: ' + str ( calls_remaining ) + '\nUsed ' + str ( calls_used ) + ' API calls.' )
Does setup such as login, printing API info, and waiting for GitHub to
        build the commit statistics. Then gets the last year of commits and
        prints them to file.
Does setup such as login printing API info and waiting for GitHub to build the commit statistics . Then gets the last year of commits and prints them to file .