def _parse_table(value):
    """
    Parses a textual table that the console commands generate.
    Each row is converted into a dictionary.
    """
    lines = value.split('\n')
    header = None
    rows = []

    for l in lines:
        if l.startswith('+-'):
            pass
        elif l.startswith('|'):
            columns = [c.strip() for c in l.split('|')[1:-1]]
            if header is None:
                header = columns
            else:
                row = {}
                for i, c in enumerate(columns):
                    if len(header)-1 <= i:
                        row[i] = c
                    else:
                        row[header[i]] = c
                rows.append(row)
    return rows