Пример #1
0
def output_records(records, columns, dump):
    if dump:
        for r in records:
            print r
        return

    if not columns:
        columns = ['time']
    else:
        columns = split_commas(columns)

    for r in records:
        print ' '.join(str(getattr(r, c)) for c in columns)
Пример #2
0
def output_records(records, columns, dump, mode):
    if mode.lower() == "raw":
        import sys
    if dump:
        for r in records:
            if mode.lower() == "raw":
                sys.stdout.write(r)
            else:
                print r
        return

    if not columns:
        columns = ['time']
    else:
        columns = split_commas(columns)

    for r in records:
        print ' '.join(str(getattr(r, c)) for c in columns)
Пример #3
0
def split_commas_case(input, output):
    eq_(split_commas(input), output)
Пример #4
0
def split_commas_case(input, output):
    eq_(split_commas(input), output)