This commit is contained in:
Jamie Hardt
2022-11-04 12:50:13 -07:00
5 changed files with 23 additions and 16 deletions

View File

@@ -1,5 +1,5 @@
from ptulsconv.docparser.ptuls_grammar import protools_text_export_grammar from ptulsconv.docparser.ptuls_grammar import protools_text_export_grammar
__version__ = '0.8.3' __version__ = '0.8.4'
__author__ = 'Jamie Hardt' __author__ = 'Jamie Hardt'
__license__ = 'MIT' __license__ = 'MIT'

View File

@@ -17,8 +17,9 @@ from ptulsconv.reporting import print_status_style, print_banner_style, print_se
def dump_field_map(output=sys.stdout): def dump_field_map(output=sys.stdout):
from ptulsconv.docparser.tag_mapping import TagMapping from ptulsconv.docparser.tag_mapping import TagMapping
from ptulsconv.docparser.adr_entity import ADRLine from ptulsconv.docparser.adr_entity import ADRLine, GenericEvent
TagMapping.print_rules(GenericEvent, output=output)
TagMapping.print_rules(ADRLine, output=output) TagMapping.print_rules(ADRLine, output=output)

View File

@@ -148,7 +148,7 @@ def populate_columns(lines: List[ADRLine], columns, include_omitted, _page_size)
styles = list() styles = list()
columns_widths = list() columns_widths = list()
sorted_character_numbers = sorted(set([x.character_id for x in lines]), sorted_character_numbers: List[str] = sorted(set([x.character_id for x in lines]),
key=lambda x: str(x)) key=lambda x: str(x))
# construct column styles # construct column styles
@@ -164,18 +164,21 @@ def populate_columns(lines: List[ADRLine], columns, include_omitted, _page_size)
for n in sorted_character_numbers: for n in sorted_character_numbers:
char_records = [x for x in lines if x.character_id == n] char_records = [x for x in lines if x.character_id == n]
row_data = list() if len(char_records) > 0:
row_data2 = list() row_data = list()
for col in columns: row_data2 = list()
row1_index = len(data)
row2_index = row1_index + 1
row_data.append(col['value_getter'](list(char_records)))
row_data2.append(col['value_getter2'](list(char_records)))
styles.extend([('TEXTCOLOR', (0, row2_index), (-1, row2_index), colors.red),
('LINEBELOW', (0, row2_index), (-1, row2_index), 0.5, colors.black)])
data.append(row_data) for col in columns:
data.append(row_data2) row1_index = len(data)
row2_index = row1_index + 1
row_data.append(col['value_getter'](list(char_records)))
row_data2.append(col['value_getter2'](list(char_records)))
styles.extend([('TEXTCOLOR', (0, row2_index), (-1, row2_index), colors.red),
('LINEBELOW', (0, row2_index), (-1, row2_index), 0.5, colors.black)])
data.append(row_data)
data.append(row_data2)
summary_row1 = list() summary_row1 = list()
summary_row2 = list() summary_row2 = list()

View File

@@ -34,6 +34,9 @@ def build_aux_data_field(line: ADRLine):
elif line.adlib: elif line.adlib:
bg_color = 'purple' bg_color = 'purple'
tag_field += "<font backColor=%s textColor=%s fontSize=11>%s</font> " % (bg_color, fg_color, "ADLIB") tag_field += "<font backColor=%s textColor=%s fontSize=11>%s</font> " % (bg_color, fg_color, "ADLIB")
elif line.optional:
bg_color = 'green'
tag_field += "<font backColor=%s textColor=%s fontSize=11>%s</font>" % (bg_color, fg_color, "OPTIONAL")
entries.append(tag_field) entries.append(tag_field)

View File

@@ -24,7 +24,7 @@ def output_report(lines: List[ADRLine], tc_display_format: TimecodeFormat, font_
char_lines = [line for line in lines if not line.omitted and line.character_id == n] char_lines = [line for line in lines if not line.omitted and line.character_id == n]
character_name = char_lines[0].character_name character_name = char_lines[0].character_name
sorted(char_lines, key=lambda line: line.start) char_lines = sorted(char_lines, key=lambda line: line.start)
title = "%s (%s) %s ADR Script" % (char_lines[0].title, character_name, n) title = "%s (%s) %s ADR Script" % (char_lines[0].title, character_name, n)
filename = "%s_%s_%s_ADR Script.pdf" % (char_lines[0].title, n, character_name) filename = "%s_%s_%s_ADR Script.pdf" % (char_lines[0].title, n, character_name)