scripts/get_year_commits.py
def calc_total_commits(self, starting_commits=0):
        """
        Uses the weekly commits and traverses back through the last
        year, each week subtracting the weekly commits and storing them. It
        needs an initial starting commits number, which should be taken from
        the most up to date number from github_stats.py output.
        """
        for week_of_commits in self.commits_dict_list:
            try:
                self.commits[week_of_commits['week']] -= week_of_commits['total']
            except KeyError:
                total = self.commits[week_of_commits['week']] \
                    = -week_of_commits['total']
        self.sorted_weeks = sorted(self.commits)

        #reverse because lower numbered weeks are older in time.
        #we traverse from most recent to oldest
        for week in reversed(self.sorted_weeks):
            self.commits[week] = self.commits[week] + starting_commits
            starting_commits = self.commits[week]
def calc_total_commits(self, starting_commits=0):
        """
        Uses the weekly commits and traverses back through the last
        year, each week subtracting the weekly commits and storing them. It
        needs an initial starting commits number, which should be taken from
        the most up to date number from github_stats.py output.
        """
        for week_of_commits in self.commits_dict_list:
            try:
                self.commits[week_of_commits['week']] -= week_of_commits['total']
            except KeyError:
                total = self.commits[week_of_commits['week']] \
                    = -week_of_commits['total']
        self.sorted_weeks = sorted(self.commits)

        #reverse because lower numbered weeks are older in time.
        #we traverse from most recent to oldest
        for week in reversed(self.sorted_weeks):
            self.commits[week] = self.commits[week] + starting_commits
            starting_commits = self.commits[week]
Uses the weekly commits and traverses back through the last
        year, each week subtracting the weekly commits and storing them. It
        needs an initial starting commits number, which should be taken from
        the most up to date number from github_stats.py output.