catherder/classes.py
def load_local(cls, address, default=False):
        r"""Get the local data for the specified address."""
        if isinstance(address, config.str_types):
            assert(os.path.isfile(address))
            fd = open(address, newline='')
        else:
            fd = address
        unused_fields = ['Duration', 'Predecessors']
        goals = []
        objectives = []
        milestones = []
        # Read
        try:
            reader = csv.DictReader(fd)
            objective = None
            for row in reader:
                if not row['Task Name']:
                    continue
                elif row['Task Name'].startswith('Goal'):
                    goals.append(row)
                elif row['Task Name'].startswith('Supporting objective'):
                    objective = row
                    objectives.append(objective)
                else:
                    func = GithubAPI.get_milestone_from_Smartsheet_objective
                    row['Supporting Objective'] = func(objective)['title']
                    for k in unused_fields:
                        row.pop(k)
                    milestones.append(row)
        finally:
            if isinstance(address, config.str_types):
                fd.close()
        return {'goals': goals, 'objectives': objectives,
                'milestones': milestones}
r"""Get the local data for the specified address.
r"""Get the local data for the specified address.
r " " " Get the local data for the specified address .
def load_local(cls, address, default=False):
        if isinstance(address, config.str_types):
            assert(os.path.isfile(address))
            fd = open(address, newline='')
        else:
            fd = address
        unused_fields = ['Duration', 'Predecessors']
        goals = []
        objectives = []
        milestones = []
        try:
            reader = csv.DictReader(fd)
            objective = None
            for row in reader:
                if not row['Task Name']:
                    continue
                elif row['Task Name'].startswith('Goal'):
                    goals.append(row)
                elif row['Task Name'].startswith('Supporting objective'):
                    objective = row
                    objectives.append(objective)
                else:
                    func = GithubAPI.get_milestone_from_Smartsheet_objective
                    row['Supporting Objective'] = func(objective)['title']
                    for k in unused_fields:
                        row.pop(k)
                    milestones.append(row)
        finally:
            if isinstance(address, config.str_types):
                fd.close()
        return {'goals': goals, 'objectives': objectives,
                'milestones': milestones}
def load_local ( cls , address , default = False ) : if isinstance ( address , config . str_types ) : assert ( os . path . isfile ( address ) ) fd = open ( address , newline = '' ) else : fd = address unused_fields = [ 'Duration' , 'Predecessors' ] goals = [ ] objectives = [ ] milestones = [ ] try : reader = csv . DictReader ( fd ) objective = None for row in reader : if not row [ 'Task Name' ] : continue elif row [ 'Task Name' ] . startswith ( 'Goal' ) : goals . append ( row ) elif row [ 'Task Name' ] . startswith ( 'Supporting objective' ) : objective = row objectives . append ( objective ) else : func = GithubAPI . get_milestone_from_Smartsheet_objective row [ 'Supporting Objective' ] = func ( objective ) [ 'title' ] for k in unused_fields : row . pop ( k ) milestones . append ( row ) finally : if isinstance ( address , config . str_types ) : fd . close ( ) return { 'goals' : goals , 'objectives' : objectives , 'milestones' : milestones }
r"""Get the local data for the specified address.
r " " " Get the local data for the specified address .
r"""Get the local data for the specified address.""" # Read
cls
address
default