catherder/classes.py
def update_from_github(self, prev, other):
        r"""Return a version of the local data updated with data from the
        provided Github data dictionary.

        Args:
            prev (dict): Smartsheet data dictionary to update.
            other (dict): Github data dictionary to update from.

        Returns:
            dict: Updated version of prev.

        """
        map_objectives = {x['Task Name']: x for x in prev['objectives']}
        map_milestones = {x['Task Name']: x for x in prev['milestones']}
        # Update Smartsheet objectives from Github milestones
        for x_gh in other.local_data['milestones']:
            x_sm = self.get_objective_from_Github_milestone(x_gh)
            y_sm = map_objectives.get(x_sm['Task Name'], None)
            if y_sm is None:
                prev['objectives'].append(x_sm)
            else:
                y_sm.update(x_sm)
        # Update Smartsheet milestones from Github issues
        for x_gh in other.local_data['issues']:
            if x_gh['title'] not in map_milestones:
                self.logger.info("Non-milestone issue: '%s'" % x_gh['title'])
                continue
            x_sm = self.get_milestone_from_Github_issue(x_gh)
            y_sm = map_milestones.get(x_sm['Task Name'], None)
            if y_sm is None:
                if x_sm['Supporting Objective'] is not None:
                    prev['milestones'].append(x_sm)
            else:
                if (((x_gh['column'] == 'To do')
                     and (y_sm['Status'] in ['', 'Not Started']))):
                    x_sm['Status'] = y_sm['Status']
                y_sm.update(x_sm)
        return prev
r"""Return a version of the local data updated with data from the
        provided Github data dictionary.

        Args:
            prev (dict): Smartsheet data dictionary to update.
            other (dict): Github data dictionary to update from.

        Returns:
            dict: Updated version of prev.

        
r"""Return a version of the local data updated with data from the
provided Github data dictionary.
r " " " Return a version of the local data updated with data from the provided Github data dictionary .
def update_from_github(self, prev, other):
        map_objectives = {x['Task Name']: x for x in prev['objectives']}
        map_milestones = {x['Task Name']: x for x in prev['milestones']}
        for x_gh in other.local_data['milestones']:
            x_sm = self.get_objective_from_Github_milestone(x_gh)
            y_sm = map_objectives.get(x_sm['Task Name'], None)
            if y_sm is None:
                prev['objectives'].append(x_sm)
            else:
                y_sm.update(x_sm)
        for x_gh in other.local_data['issues']:
            if x_gh['title'] not in map_milestones:
                self.logger.info("Non-milestone issue: '%s'" % x_gh['title'])
                continue
            x_sm = self.get_milestone_from_Github_issue(x_gh)
            y_sm = map_milestones.get(x_sm['Task Name'], None)
            if y_sm is None:
                if x_sm['Supporting Objective'] is not None:
                    prev['milestones'].append(x_sm)
            else:
                if (((x_gh['column'] == 'To do')
                     and (y_sm['Status'] in ['', 'Not Started']))):
                    x_sm['Status'] = y_sm['Status']
                y_sm.update(x_sm)
        return prev
def update_from_github ( self , prev , other ) : map_objectives = { x [ 'Task Name' ] : x for x in prev [ 'objectives' ] } map_milestones = { x [ 'Task Name' ] : x for x in prev [ 'milestones' ] } for x_gh in other . local_data [ 'milestones' ] : x_sm = self . get_objective_from_Github_milestone ( x_gh ) y_sm = map_objectives . get ( x_sm [ 'Task Name' ] , None ) if y_sm is None : prev [ 'objectives' ] . append ( x_sm ) else : y_sm . update ( x_sm ) for x_gh in other . local_data [ 'issues' ] : if x_gh [ 'title' ] not in map_milestones : self . logger . info ( "Non-milestone issue: '%s'" % x_gh [ 'title' ] ) continue x_sm = self . get_milestone_from_Github_issue ( x_gh ) y_sm = map_milestones . get ( x_sm [ 'Task Name' ] , None ) if y_sm is None : if x_sm [ 'Supporting Objective' ] is not None : prev [ 'milestones' ] . append ( x_sm ) else : if ( ( ( x_gh [ 'column' ] == 'To do' ) and ( y_sm [ 'Status' ] in [ '' , 'Not Started' ] ) ) ) : x_sm [ 'Status' ] = y_sm [ 'Status' ] y_sm . update ( x_sm ) return prev
r"""Return a version of the local data updated with data from the
provided Github data dictionary.
r " " " Return a version of the local data updated with data from the provided Github data dictionary .
r"""Return a version of the local data updated with data from the
        provided Github data dictionary.

        Args:
            prev (dict): Smartsheet data dictionary to update.
            other (dict): Github data dictionary to update from.

        Returns:
            dict: Updated version of prev.

        """ # Update Smartsheet objectives from Github milestones # Update Smartsheet milestones from Github issues
Updated version of prev.
Updated version of prev .
dict
self
prev
Smartsheet data dictionary to update.
Smartsheet data dictionary to update .
other
Github data dictionary to update from.
Github data dictionary to update from .