Returns the length of non-empty content in a given row.

def row_content_length(row):
    '''
    Returns the length of non-empty content in a given row.
    '''
    if not row:
        return 0
    try:
        return (index + 1 for index, cell in reversed(list(enumerate(row))) if not is_empty_cell(cell)).next()
    except StopIteration:
        return len(row)