mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2025-12-31 08:50:48 +00:00
Continuity implementation
This commit is contained in:
@@ -19,6 +19,7 @@ from ptulsconv.pdf.supervisor_1pg import output_report as output_supervisor_1pg
|
||||
from ptulsconv.pdf.line_count import output_report as output_line_count
|
||||
from ptulsconv.pdf.talent_sides import output_report as output_talent_sides
|
||||
from ptulsconv.pdf.summary_log import output_report as output_summary
|
||||
from ptulsconv.pdf.continuity import output_report as output_continuity
|
||||
|
||||
from json import JSONEncoder
|
||||
|
||||
@@ -160,6 +161,12 @@ def convert(input_file, major_mode='fmpxml', output=sys.stdout, warnings=True):
|
||||
os.makedirs(reports_dir, exist_ok=False)
|
||||
os.chdir(reports_dir)
|
||||
|
||||
scenes = sorted([s for s in compiler.compile_all_time_spans() if s[0] == 'Sc'],
|
||||
key=lambda x: x[2])
|
||||
|
||||
output_continuity(scenes=scenes, tc_display_format=session_tc_format,
|
||||
title=list(titles)[0], client="", supervisor="")
|
||||
|
||||
# reels = sorted([r for r in compiler.compile_all_time_spans() if r[0] == 'Reel'],
|
||||
# key=lambda x: x[2])
|
||||
reels = ['R1', 'R2', 'R3', 'R4', 'R5', 'R6']
|
||||
|
||||
@@ -2,26 +2,56 @@ from fractions import Fraction
|
||||
from typing import Tuple, List
|
||||
|
||||
from reportlab.lib.pagesizes import portrait, letter
|
||||
from reportlab.lib.styles import getSampleStyleSheet
|
||||
from reportlab.lib.units import inch
|
||||
from reportlab.platypus import Paragraph, Table, Spacer
|
||||
|
||||
from ptulsconv.broadcast_timecode import TimecodeFormat
|
||||
from ptulsconv.pdf import make_doc_template
|
||||
|
||||
|
||||
# TODO: A Continuity
|
||||
|
||||
def output_report(scenes: List[Tuple[str, Fraction, Fraction]],
|
||||
tc_display_format: TimecodeFormat,
|
||||
title: str, client: str, supervisor,
|
||||
page_size=portrait(letter)):
|
||||
def table_for_scene(scene, tc_format):
|
||||
scene_style = getSampleStyleSheet()['Normal']
|
||||
scene_style.fontName = 'Futura'
|
||||
scene_style.leftIndent = 0.
|
||||
scene_style.leftPadding = 0.
|
||||
scene_style.spaceAfter = 18.
|
||||
|
||||
filename = "%s Continuity" % title
|
||||
tc_data = "<em>%s</em><br />%s" % (tc_format.seconds_to_smpte(scene[2]), tc_format.seconds_to_smpte(scene[3]))
|
||||
|
||||
row = [
|
||||
Paragraph(tc_data, scene_style),
|
||||
Paragraph(scene[1], scene_style),
|
||||
]
|
||||
|
||||
style = [('VALIGN', (0, 0), (-1, -1), 'TOP'),
|
||||
('LEFTPADDING', (0, 0), (0, 0), 0.0),
|
||||
('BOTTOMPADDING', (0, 0), (-1, -1), 12.),
|
||||
('FONTNAME', (0, 0), (-1, -1), 'Futura')]
|
||||
|
||||
return Table(data=[row], style=style, colWidths=[1.0 * inch, 6.5 * inch])
|
||||
|
||||
|
||||
def output_report(scenes: List[Tuple[str, str, Fraction, Fraction]],
|
||||
tc_display_format: TimecodeFormat,
|
||||
title: str, client: str, supervisor):
|
||||
filename = "%s Continuity.pdf" % title
|
||||
document_header = "Continuity"
|
||||
|
||||
doc = make_doc_template(page_size=page_size,
|
||||
filename=filename, document_title=title,
|
||||
doc = make_doc_template(page_size=portrait(letter),
|
||||
filename=filename,
|
||||
document_title="Continuity",
|
||||
title=title,
|
||||
client=client,
|
||||
document_subheader="",
|
||||
supervisor=supervisor,
|
||||
document_header=document_header,
|
||||
left_margin=0.75 * inch)
|
||||
left_margin=0.5 * inch)
|
||||
story = list()
|
||||
# story.append(Spacer(height=0.5 * inch, width=1.))
|
||||
for scene in scenes:
|
||||
story.append(table_for_scene(scene, tc_display_format))
|
||||
|
||||
doc.build(story)
|
||||
|
||||
Reference in New Issue
Block a user