mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2025-12-31 08:50:48 +00:00
Merge branch 'master' of https://github.com/iluvcapra/ptulsconv
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from ptulsconv.docparser.ptuls_grammar import protools_text_export_grammar
|
||||
|
||||
__version__ = '0.8.3'
|
||||
__version__ = '0.8.4'
|
||||
__author__ = 'Jamie Hardt'
|
||||
__license__ = 'MIT'
|
||||
|
||||
@@ -17,8 +17,9 @@ from ptulsconv.reporting import print_status_style, print_banner_style, print_se
|
||||
|
||||
def dump_field_map(output=sys.stdout):
|
||||
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)
|
||||
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ def populate_columns(lines: List[ADRLine], columns, include_omitted, _page_size)
|
||||
styles = 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))
|
||||
|
||||
# construct column styles
|
||||
@@ -164,13 +164,16 @@ def populate_columns(lines: List[ADRLine], columns, include_omitted, _page_size)
|
||||
|
||||
for n in sorted_character_numbers:
|
||||
char_records = [x for x in lines if x.character_id == n]
|
||||
if len(char_records) > 0:
|
||||
row_data = list()
|
||||
row_data2 = list()
|
||||
|
||||
for col in columns:
|
||||
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)])
|
||||
|
||||
|
||||
@@ -34,6 +34,9 @@ def build_aux_data_field(line: ADRLine):
|
||||
elif line.adlib:
|
||||
bg_color = 'purple'
|
||||
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)
|
||||
|
||||
|
||||
@@ -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]
|
||||
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)
|
||||
filename = "%s_%s_%s_ADR Script.pdf" % (char_lines[0].title, n, character_name)
|
||||
|
||||
Reference in New Issue
Block a user