diff --git a/example/Charade/full/Charade ADR Report.pdf b/example/Charade/full/Charade ADR Report.pdf new file mode 100644 index 0000000..d136764 Binary files /dev/null and b/example/Charade/full/Charade ADR Report.pdf differ diff --git a/example/Charade/full/Charade Line Count.pdf b/example/Charade/full/Charade Line Count.pdf new file mode 100644 index 0000000..fcdb545 Binary files /dev/null and b/example/Charade/full/Charade Line Count.pdf differ diff --git a/example/Charade/full/Supervisor Logs/Charade_1_PETER_Log.pdf b/example/Charade/full/Supervisor Logs/Charade_1_PETER_Log.pdf new file mode 100644 index 0000000..319e063 Binary files /dev/null and b/example/Charade/full/Supervisor Logs/Charade_1_PETER_Log.pdf differ diff --git a/example/Charade/full/Supervisor Logs/Charade_2_REGGIE_Log.pdf b/example/Charade/full/Supervisor Logs/Charade_2_REGGIE_Log.pdf new file mode 100644 index 0000000..bee0cde Binary files /dev/null and b/example/Charade/full/Supervisor Logs/Charade_2_REGGIE_Log.pdf differ diff --git a/example/Charade/full/Supervisor Logs/Charade_3_BARTHOLOMEW_Log.pdf b/example/Charade/full/Supervisor Logs/Charade_3_BARTHOLOMEW_Log.pdf new file mode 100644 index 0000000..13c87f3 Binary files /dev/null and b/example/Charade/full/Supervisor Logs/Charade_3_BARTHOLOMEW_Log.pdf differ diff --git a/example/Charade/full/Supervisor Logs/Charade_4_TEX_Log.pdf b/example/Charade/full/Supervisor Logs/Charade_4_TEX_Log.pdf new file mode 100644 index 0000000..cd7df79 Binary files /dev/null and b/example/Charade/full/Supervisor Logs/Charade_4_TEX_Log.pdf differ diff --git a/example/Charade/full/Supervisor Logs/Charade_5_SCOBIE_Log.pdf b/example/Charade/full/Supervisor Logs/Charade_5_SCOBIE_Log.pdf new file mode 100644 index 0000000..6381902 Binary files /dev/null and b/example/Charade/full/Supervisor Logs/Charade_5_SCOBIE_Log.pdf differ diff --git a/example/Charade/full/Supervisor Logs/Charade_6_SYLVIE_Log.pdf b/example/Charade/full/Supervisor Logs/Charade_6_SYLVIE_Log.pdf new file mode 100644 index 0000000..3af398f Binary files /dev/null and b/example/Charade/full/Supervisor Logs/Charade_6_SYLVIE_Log.pdf differ diff --git a/example/Charade/full/Supervisor Logs/Charade_7_GIDEON_Log.pdf b/example/Charade/full/Supervisor Logs/Charade_7_GIDEON_Log.pdf new file mode 100644 index 0000000..83f2eaa Binary files /dev/null and b/example/Charade/full/Supervisor Logs/Charade_7_GIDEON_Log.pdf differ diff --git a/example/Charade/full/Supervisor Logs/Charade_8m_JEAN-LOUIS_Log.pdf b/example/Charade/full/Supervisor Logs/Charade_8m_JEAN-LOUIS_Log.pdf new file mode 100644 index 0000000..b7de7f1 Binary files /dev/null and b/example/Charade/full/Supervisor Logs/Charade_8m_JEAN-LOUIS_Log.pdf differ diff --git a/example/Charade/full/Supervisor Logs/Charade_99g_Group_Log.pdf b/example/Charade/full/Supervisor Logs/Charade_99g_Group_Log.pdf new file mode 100644 index 0000000..e14e6e7 Binary files /dev/null and b/example/Charade/full/Supervisor Logs/Charade_99g_Group_Log.pdf differ diff --git a/example/Charade/full/Talent Scripts/Charade_1_PETER_ADR Script.pdf b/example/Charade/full/Talent Scripts/Charade_1_PETER_ADR Script.pdf new file mode 100644 index 0000000..6e0f836 Binary files /dev/null and b/example/Charade/full/Talent Scripts/Charade_1_PETER_ADR Script.pdf differ diff --git a/example/Charade/full/Talent Scripts/Charade_2_REGGIE_ADR Script.pdf b/example/Charade/full/Talent Scripts/Charade_2_REGGIE_ADR Script.pdf new file mode 100644 index 0000000..57fb73d Binary files /dev/null and b/example/Charade/full/Talent Scripts/Charade_2_REGGIE_ADR Script.pdf differ diff --git a/example/Charade/full/Talent Scripts/Charade_3_BARTHOLOMEW_ADR Script.pdf b/example/Charade/full/Talent Scripts/Charade_3_BARTHOLOMEW_ADR Script.pdf new file mode 100644 index 0000000..ecda126 Binary files /dev/null and b/example/Charade/full/Talent Scripts/Charade_3_BARTHOLOMEW_ADR Script.pdf differ diff --git a/example/Charade/full/Talent Scripts/Charade_4_TEX_ADR Script.pdf b/example/Charade/full/Talent Scripts/Charade_4_TEX_ADR Script.pdf new file mode 100644 index 0000000..ec4dd9a Binary files /dev/null and b/example/Charade/full/Talent Scripts/Charade_4_TEX_ADR Script.pdf differ diff --git a/example/Charade/full/Talent Scripts/Charade_5_SCOBIE_ADR Script.pdf b/example/Charade/full/Talent Scripts/Charade_5_SCOBIE_ADR Script.pdf new file mode 100644 index 0000000..2a335f3 Binary files /dev/null and b/example/Charade/full/Talent Scripts/Charade_5_SCOBIE_ADR Script.pdf differ diff --git a/example/Charade/full/Talent Scripts/Charade_6_SYLVIE_ADR Script.pdf b/example/Charade/full/Talent Scripts/Charade_6_SYLVIE_ADR Script.pdf new file mode 100644 index 0000000..3edb4a1 Binary files /dev/null and b/example/Charade/full/Talent Scripts/Charade_6_SYLVIE_ADR Script.pdf differ diff --git a/example/Charade/full/Talent Scripts/Charade_7_GIDEON_ADR Script.pdf b/example/Charade/full/Talent Scripts/Charade_7_GIDEON_ADR Script.pdf new file mode 100644 index 0000000..d8f2d4f Binary files /dev/null and b/example/Charade/full/Talent Scripts/Charade_7_GIDEON_ADR Script.pdf differ diff --git a/example/Charade/full/Talent Scripts/Charade_8m_JEAN-LOUIS_ADR Script.pdf b/example/Charade/full/Talent Scripts/Charade_8m_JEAN-LOUIS_ADR Script.pdf new file mode 100644 index 0000000..46931bc Binary files /dev/null and b/example/Charade/full/Talent Scripts/Charade_8m_JEAN-LOUIS_ADR Script.pdf differ diff --git a/example/Charade/full/Talent Scripts/Charade_99g_Group_ADR Script.pdf b/example/Charade/full/Talent Scripts/Charade_99g_Group_ADR Script.pdf new file mode 100644 index 0000000..29bb030 Binary files /dev/null and b/example/Charade/full/Talent Scripts/Charade_99g_Group_ADR Script.pdf differ diff --git a/ptulsconv/pdf/line_count.py b/ptulsconv/pdf/line_count.py index f0bdaee..fbeb90d 100644 --- a/ptulsconv/pdf/line_count.py +++ b/ptulsconv/pdf/line_count.py @@ -10,17 +10,10 @@ from reportlab.platypus import Table from .common import time_format, make_doc_template -def build_columns(records, show_priorities=False): +def build_columns(records, show_priorities=False, include_omitted=False): columns = list() reel_numbers = sorted(set([x['Reel'] for x in records['events'] if 'Reel' in x.keys()])) - def blank_len(i): - length = len(i) - if length == 0: - return "" - else: - return str(length) - num_column_width = 0.375 * inch columns.append({ @@ -54,7 +47,7 @@ def build_columns(records, show_priorities=False): for n in reel_numbers: columns.append({ 'heading': n, - 'value_getter': lambda recs, n1=n: blank_len([r for r in recs if r['Reel'] == n1]), + 'value_getter': lambda recs, n1=n: len([r for r in recs if r['Reel'] == n1]), 'value_getter2': lambda recs, n1=n: time_format(sum([r.get('Time Budget Mins', 0.) for r in recs if r['Reel'] == n1])), 'style_getter': lambda col_index: [('ALIGN', (col_index, 0), (col_index, -1), 'CENTER'), @@ -66,7 +59,7 @@ def build_columns(records, show_priorities=False): for n in range(1, 6,): columns.append({ 'heading': 'P%i' % n, - 'value_getter': lambda recs: blank_len([r for r in recs if r.get('Priority', None) == n]), + 'value_getter': lambda recs: len([r for r in recs if r.get('Priority', None) == n]), 'value_getter2': lambda recs: time_format(sum([r.get('Time Budget Mins', 0.) for r in recs if r.get('Priority', None) == n])), 'style_getter': lambda col_index: [], @@ -75,7 +68,7 @@ def build_columns(records, show_priorities=False): columns.append({ 'heading': '>P5', - 'value_getter': lambda recs: blank_len([r for r in recs if r.get('Priority', 5) > 5]), + 'value_getter': lambda recs: len([r for r in recs if r.get('Priority', 5) > 5]), 'value_getter2': lambda recs: time_format(sum([r.get('Time Budget Mins', 0.) for r in recs if r.get('Priority', 5) > 5])), 'style_getter': lambda col_index: [], @@ -84,7 +77,7 @@ def build_columns(records, show_priorities=False): columns.append({ 'heading': 'TV', - 'value_getter': lambda recs: blank_len([r for r in recs if 'TV' in r.keys()]), + 'value_getter': lambda recs: len([r for r in recs if 'TV' in r.keys()]), 'value_getter2': lambda recs: time_format(sum([r.get('Time Budget Mins', 0.) for r in recs if 'TV' in r.keys()])), 'style_getter': lambda col_index: [('ALIGN', (col_index, 0), (col_index, -1), 'CENTER'), @@ -95,7 +88,7 @@ def build_columns(records, show_priorities=False): columns.append({ 'heading': 'Opt', - 'value_getter': lambda recs: blank_len([r for r in recs if 'Optional' in r.keys()]), + 'value_getter': lambda recs: len([r for r in recs if 'Optional' in r.keys()]), 'value_getter2': lambda recs: time_format(sum([r.get('Time Budget Mins', 0.) for r in recs if 'Optional' in r.keys()])), 'style_getter': lambda col_index: [('ALIGN', (col_index, 0), (col_index, -1), 'CENTER'), @@ -105,13 +98,23 @@ def build_columns(records, show_priorities=False): columns.append({ 'heading': 'Eff', - 'value_getter': lambda recs: blank_len([r for r in recs if 'Effort' in r.keys()]), + 'value_getter': lambda recs: len([r for r in recs if 'Effort' in r.keys()]), 'value_getter2': lambda recs: time_format(sum([r.get('Time Budget Mins',0.) for r in recs if 'Effort' in r.keys()])), 'style_getter': lambda col_index: [('ALIGN', (col_index, 0), (col_index, -1), 'CENTER')], 'width': num_column_width }) + if include_omitted: + columns.append({ + 'heading': 'Omit', + 'value_getter': lambda recs: len([r for r in recs if 'Omitted' in r.keys()]), + 'value_getter2': lambda recs: time_format(sum([r.get('Time Budget Mins', 0.) + for r in recs if 'Omitted' in r.keys()])), + 'style_getter': lambda col_index: [('ALIGN', (col_index, 0), (col_index, -1), 'CENTER')], + 'width': num_column_width + }) + columns.append({ 'heading': 'Total', 'value_getter': lambda recs: len([r for r in recs if 'Omitted' not in r.keys()]), @@ -125,7 +128,7 @@ def build_columns(records, show_priorities=False): return columns -def populate_columns(records, columns): +def populate_columns(records, columns, include_omitted, page_size): data = list() styles = list() columns_widths = list() @@ -142,7 +145,10 @@ def populate_columns(records, columns): data.append(list(map(lambda x: x['heading'], columns))) - lines = [x for x in records['events'] if 'Omitted' not in x.keys()] + if include_omitted: + lines = [x for x in records['events']] + else: + lines = [x for x in records['events'] if 'Omitted' not in x.keys()] for n in sorted_character_numbers: char_records = list([x for x in lines if x['Character Number'] == n]) @@ -179,9 +185,9 @@ def populate_columns(records, columns): return data, styles, columns_widths -def output_report(records): - columns = build_columns(records) - data, style, columns_widths = populate_columns(records, columns) +def output_report(records, include_omitted=False, page_size=portrait(letter)): + columns = build_columns(records, include_omitted) + data, style, columns_widths = populate_columns(records, columns, include_omitted, page_size) style.append(('FONTNAME', (0, 0), (-1, -1), "Futura")) style.append(('FONTSIZE', (0, 0), (-1, -1), 9.)) style.append(('LINEBELOW', (0, 0), (-1, 0), 1.0, colors.black)) @@ -191,9 +197,10 @@ def output_report(records): title = "%s Line Count" % (records['events'][0]['Title']) filename = title + '.pdf' - doc = make_doc_template(portrait(letter), filename=filename, + doc = make_doc_template(page_size=page_size, filename=filename, document_title=title, - record=records['events'][0], document_header='Line Count') + record=records['events'][0], + document_header='Line Count') table = Table(data=data, style=style, colWidths=columns_widths) diff --git a/ptulsconv/pdf/summary_log.py b/ptulsconv/pdf/summary_log.py index 70a355e..8d60b24 100644 --- a/ptulsconv/pdf/summary_log.py +++ b/ptulsconv/pdf/summary_log.py @@ -89,13 +89,14 @@ def build_story(lines): return story -def output_report(records): +def output_report(records, page_size=portrait(letter)): lines = sorted(records['events'], key=lambda line: line['PT.Clip.Start_Seconds']) title = "%s ADR Report" % (lines[0]['Title']) filename = title + ".pdf" - doc = make_doc_template(portrait(letter), filename=filename, document_title=title, + doc = make_doc_template(page_size=page_size, + filename=filename, document_title=title, record=lines[0], document_header='ADR Report') story = build_story(lines)