mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2026-01-01 17:30:47 +00:00
Adjusted header appearance
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
|
||||
@@ -81,11 +82,16 @@ def output_avid_markers(lines):
|
||||
def create_adr_reports(lines: List[ADRLine], tc_display_format: TimecodeFormat):
|
||||
|
||||
print_section_header_style("Creating PDF Reports")
|
||||
report_date = datetime.datetime.now()
|
||||
reports_dir = "%s_%s" % (lines[0].title, report_date.strftime("%Y-%m-%d_%H%M"))
|
||||
os.makedirs(reports_dir, exist_ok=False)
|
||||
os.chdir(reports_dir)
|
||||
|
||||
print_status_style("Creating ADR Report")
|
||||
output_summary(lines, tc_display_format=tc_display_format)
|
||||
|
||||
print_status_style("Creating Line Count")
|
||||
output_line_count(lines, reel_list=['R1', 'R2', 'R3', 'R4', 'R5', 'R6', 'R7'])
|
||||
output_line_count(lines, reel_list=['R1', 'R2', 'R3', 'R4', 'R5', 'R6'])
|
||||
|
||||
print_status_style("Creating Supervisor Logs directory and reports")
|
||||
os.makedirs("Supervisor Logs", exist_ok=True)
|
||||
|
||||
@@ -62,7 +62,7 @@ def make_doc_template(page_size, filename, document_title, record: ADRLine, docu
|
||||
|
||||
footer_box, page_box = page_box.split_y(0.25 * inch, direction='u')
|
||||
header_box, page_box = page_box.split_y(0.75 * inch, direction='d')
|
||||
title_box, report_box = header_box.split_x(3. * inch, direction='r')
|
||||
title_box, report_box = header_box.split_x(3.5 * inch, direction='r')
|
||||
|
||||
page_template = PageTemplate(id="Main",
|
||||
frames=[Frame(page_box.min_x, page_box.min_y, page_box.width, page_box.height)],
|
||||
|
||||
@@ -5,17 +5,19 @@ import subprocess
|
||||
import sys
|
||||
import glob
|
||||
import datetime
|
||||
import ptulsconv
|
||||
|
||||
from xml.etree.ElementTree import TreeBuilder, tostring
|
||||
from typing import List
|
||||
|
||||
import ptulsconv
|
||||
from ptulsconv.docparser.adr_entity import ADRLine
|
||||
|
||||
|
||||
def avid_marker_list(lines, report_date=datetime.datetime.now(), reel_start_frame=0):
|
||||
def avid_marker_list(lines: List[ADRLine], report_date=datetime.datetime.now(), reel_start_frame=0, fps=24):
|
||||
doc = TreeBuilder(element_factory=None)
|
||||
|
||||
doc.start('Avid:StreamItems', {'xmlns:Avid': 'http://www.avid.com'})
|
||||
doc.start('Avid:XMLFileData')
|
||||
doc.start('AvProp', {'name': 'DomainMagic', 'type':'string'})
|
||||
doc.start('Avid:XMLFileData', {})
|
||||
doc.start('AvProp', {'name': 'DomainMagic', 'type': 'string'})
|
||||
doc.data("Domain")
|
||||
doc.end('AvProp')
|
||||
doc.start('AvProp', {'name': 'DomainKey', 'type': 'string'})
|
||||
@@ -23,7 +25,7 @@ def avid_marker_list(lines, report_date=datetime.datetime.now(), reel_start_fram
|
||||
doc.end('AvProp')
|
||||
|
||||
def insert_elem(kind, attb, atype, name, value):
|
||||
doc.start('ListElem')
|
||||
doc.start('ListElem', {})
|
||||
doc.start('AvProp', {'id': 'ATTR',
|
||||
'name': 'OMFI:ATTB:Kind',
|
||||
'type': 'int32'})
|
||||
@@ -54,13 +56,15 @@ def avid_marker_list(lines, report_date=datetime.datetime.now(), reel_start_fram
|
||||
|
||||
insert_elem('1', 'OMFI:ATTB:IntAttribute', 'int32', '_ATN_CRM_LONG_CREATE_DATE', report_date.strftime("%s"))
|
||||
insert_elem('2', 'OMFI:ATTB:StringAttribute', 'string', '_ATN_CRM_COLOR', 'yellow')
|
||||
insert_elem('2', 'OMFI:ATTB:StringAttribute', 'string', '_ATN_CRM_USER', line['Supervisor'])
|
||||
insert_elem('2', 'OMFI:ATTB:StringAttribute', 'string', '_ATN_CRM_USER', line.supervisor or "")
|
||||
|
||||
marker_name = "%s: %s" % (line['Cue Number'], line['Line'])
|
||||
marker_name = "%s: %s" % (line.cue_number, line.prompt)
|
||||
insert_elem('2', 'OMFI:ATTB:StringAttribute', 'string', '_ATN_CRM_COM', marker_name)
|
||||
|
||||
start_frame = int(line.start * fps)
|
||||
|
||||
insert_elem('2', "OMFI:ATTB:StringAttribute", 'string', '_ATN_CRM_TC',
|
||||
str(lines['Start Frames'] - reel_start_frame))
|
||||
str(start_frame - reel_start_frame))
|
||||
|
||||
insert_elem('2', "OMFI:ATTB:StringAttribute", 'string', '_ATN_CRM_TRK', 'V1')
|
||||
insert_elem('1', "OMFI:ATTB:IntAttribute", 'int32', '_ATN_CRM_LENGTH', '1')
|
||||
|
||||
Reference in New Issue
Block a user