Document generation tweaks

This commit is contained in:
Jamie Hardt
2021-05-19 19:33:16 -07:00
parent fe93985041
commit 00a05506d4
4 changed files with 4 additions and 4 deletions

View File

@@ -172,7 +172,7 @@ def output_report(records):
page = page.inset(inch * 0.5)
title_box, table_box = page.split_y(inch, 'd')
c = NumberedCanvas('Line Count.pdf', pagesize=(letter[1], letter[0]))
c = NumberedCanvas('%s Line Count.pdf' % records['events'][0]['Title'], pagesize=(letter[1], letter[0]))
c.setFont('Futura', 18.)
c.drawCentredString(title_box.center_x, title_box.center_y, "Line Count")

View File

@@ -101,7 +101,7 @@ def output_report(records):
lines = sorted(records['events'], key=lambda line: line['PT.Clip.Start_Seconds'])
doc = BaseDocTemplate("Summary.pdf",
doc = BaseDocTemplate("%s Summary.pdf" % records['events'][0]['Title'],
pagesize=page_size, leftMargin=0.5 * inch,
rightMargin=0.5 * inch, topMargin=0.5 * inch,
bottomMargin=0.5 * inch)

View File

@@ -185,7 +185,7 @@ def draw_footer(canvas, rect, record, report_date, line_no, total_lines):
def create_report_for_character(records, report_date):
outfile = records[0]['CN'] + '_' + records[0]['Character Name'] + '.pdf'
outfile = "%s_%s_%s_Log.pdf" % (records[0]['Title'], records[0]['Character Number'], records[0]['Character Name'],)
assert outfile is not None
assert outfile[-4:] == '.pdf', "Output file must have 'pdf' extension!"

View File

@@ -31,7 +31,7 @@ def output_report(records):
sorted(lines, key=lambda line: line['PT.Clip.Start_Seconds'])
doc = BaseDocTemplate("%s_%s_Script.pdf" % (n, lines[0]['Character Name']),
doc = BaseDocTemplate("%s_%s_%s_Script.pdf" % (lines[0]['Title'], n, lines[0]['Character Name']),
pagesize=letter, leftMargin=0.5 * inch,
rightMargin=0.5 * inch, topMargin=0.5 * inch, bottomMargin=0.5 * inch)