Adjusted header appearance

This commit is contained in:
Jamie Hardt
2021-06-03 22:08:48 -07:00
parent 7ab2907b26
commit be4a4b91c0
4 changed files with 22 additions and 36 deletions

View File

@@ -5,31 +5,7 @@
# ptulsconv # ptulsconv
Read Pro Tools text exports and generate JSON, PDF reports. Read Pro Tools text exports and generate JSON, PDF reports.
## Quick Example
At this time we're using `ptulsconv` mostly for converting ADR notes in a Pro Tools session
into an XML document we can import into Filemaker Pro.
% ptulsconv STAR_WARS_IV_R1_ADR_Notes_PT_Text_Export.txt > SW4_r1_ADR_Notes.xml
% xmllint --format SW4_r1_ADR_Notes.xml
<?xml version="1.0"?>
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<ERRORCODE>0</ERRORCODE>
<PRODUCT NAME="ptulsconv" VERSION="0.0.1"/>
<DATABASE DATEFORMAT="MM/dd/yy" LAYOUT="summary"
NAME="STAR_WARS_IV_R1_ADR_Notes_PT_Text_Export.txt"
RECORDS="84" TIMEFORMAT="hh:mm:ss"/>
<METADATA>
<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Title" TYPE="TEXT"/>
<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Supervisor" TYPE="TEXT"/>
<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Client" TYPE="TEXT"/>
<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Scene" TYPE="TEXT"/>
<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Version" TYPE="TEXT"/>
<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Reel" TYPE="TEXT"/>
<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Start" TYPE="TEXT"/>
[... much much more]
## Installation ## Installation
The easiest way to install on your site is to use `pip`: The easiest way to install on your site is to use `pip`:

View File

@@ -1,3 +1,4 @@
import datetime
import json import json
import os import os
@@ -81,11 +82,16 @@ def output_avid_markers(lines):
def create_adr_reports(lines: List[ADRLine], tc_display_format: TimecodeFormat): def create_adr_reports(lines: List[ADRLine], tc_display_format: TimecodeFormat):
print_section_header_style("Creating PDF Reports") 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") print_status_style("Creating ADR Report")
output_summary(lines, tc_display_format=tc_display_format) output_summary(lines, tc_display_format=tc_display_format)
print_status_style("Creating Line Count") 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") print_status_style("Creating Supervisor Logs directory and reports")
os.makedirs("Supervisor Logs", exist_ok=True) os.makedirs("Supervisor Logs", exist_ok=True)

View File

@@ -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') 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') 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", page_template = PageTemplate(id="Main",
frames=[Frame(page_box.min_x, page_box.min_y, page_box.width, page_box.height)], frames=[Frame(page_box.min_x, page_box.min_y, page_box.width, page_box.height)],

View File

@@ -5,17 +5,19 @@ import subprocess
import sys import sys
import glob import glob
import datetime import datetime
import ptulsconv
from xml.etree.ElementTree import TreeBuilder, tostring 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 = TreeBuilder(element_factory=None)
doc.start('Avid:StreamItems', {'xmlns:Avid': 'http://www.avid.com'}) doc.start('Avid:StreamItems', {'xmlns:Avid': 'http://www.avid.com'})
doc.start('Avid:XMLFileData') doc.start('Avid:XMLFileData', {})
doc.start('AvProp', {'name': 'DomainMagic', 'type':'string'}) doc.start('AvProp', {'name': 'DomainMagic', 'type': 'string'})
doc.data("Domain") doc.data("Domain")
doc.end('AvProp') doc.end('AvProp')
doc.start('AvProp', {'name': 'DomainKey', 'type': 'string'}) 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') doc.end('AvProp')
def insert_elem(kind, attb, atype, name, value): def insert_elem(kind, attb, atype, name, value):
doc.start('ListElem') doc.start('ListElem', {})
doc.start('AvProp', {'id': 'ATTR', doc.start('AvProp', {'id': 'ATTR',
'name': 'OMFI:ATTB:Kind', 'name': 'OMFI:ATTB:Kind',
'type': 'int32'}) '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('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_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) 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', 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('2', "OMFI:ATTB:StringAttribute", 'string', '_ATN_CRM_TRK', 'V1')
insert_elem('1', "OMFI:ATTB:IntAttribute", 'int32', '_ATN_CRM_LENGTH', '1') insert_elem('1', "OMFI:ATTB:IntAttribute", 'int32', '_ATN_CRM_LENGTH', '1')