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)
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)
def split_commas_case(input, output): eq_(split_commas(input), output)