Commit 9c8b7fc7 authored by juga  's avatar juga
Browse files

Use V3BwHeader to generate the header

parent 3f451e52
from sbws import version
from sbws.globals import (fail_hard, is_initted, time_now)
from sbws.lib.v3bwfile import V3BwHeader
from sbws.lib.resultdump import ResultSuccess
from sbws.lib.resultdump import load_recent_results_in_datadir
from sbws.lib.resultdump import group_results_by_relay
......@@ -120,10 +121,10 @@ def main(args, conf):
data_lines = [result_data_to_v3bw_line(data, fp) for fp in data]
data_lines = sorted(data_lines, key=lambda d: d.bw, reverse=True)
data_lines = scale_lines(args, data_lines)
header = V3BwHeader()
log_stats(data_lines)
log.info('Writing v3bw file to %s', args.output)
with open(args.output, 'wt') as fd:
fd.write('{}\n'.format(int(time_now())))
fd.write('version={}\n'.format(version))
fd.write(header)
for line in data_lines:
fd.write('{}\n'.format(str(line)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment