14 def __init__(self, config, trs_filename, export_filename):
19 if not self.export_filename.lower().endswith(
'.csv'):
26 def export(self, progress_update_fcn=None, progress_next_phase_fcn=None):
31 csv_writer = csv.writer(export_file, quoting=csv.QUOTE_ALL)
32 csv_writer.writerow([
'Export Date: %s' % (UIUtils.get_cur_timestamp_str())])
33 csv_writer.writerow([
'Configuration Creation Date: %s' % (self.config.created)])
34 csv_writer.writerow([
'TRS Filename: %s' % (self.
trs_filename)])
35 csv_writer.writerow([
'Output Configuration:'])
36 csv_writer.writerow([
'Name: %s' % (self.config.name)])
37 csv_writer.writerow([
'Description: %s' % (self.config.desc)])
38 csv_writer.writerow([
''])
39 csv_writer.writerow([
'Outputs:'])
40 csv_writer.writerow([
''])
44 segs = trs_parser.parse(progress_update_fcn, progress_next_phase_fcn, validate=
False)
49 while i < len(self.config.outputs):
51 if progress_next_phase_fcn:
52 progress_next_phase_fcn()
54 cur_output = self.config.outputs[i]
58 if cur_output.chained
and not chains:
59 chains = FilterManager.get_chains(segs)
62 items = chains
if cur_output.chained
else segs
65 cur_output.add_item(items[j], filter_utters=
True)
69 if progress_update_fcn:
70 progress_update_fcn(1)
73 cur_output.write_csv_rows(csv_writer)
74 csv_writer.writerow([
''])