diff --git a/ptulsconv/__main__.py b/ptulsconv/__main__.py index 9adeaf5..8d7736d 100644 --- a/ptulsconv/__main__.py +++ b/ptulsconv/__main__.py @@ -7,14 +7,6 @@ from ptulsconv.commands import convert from ptulsconv.reporting import print_status_style, print_banner_style, print_section_header_style, print_fatal_error -# TODO: Support Top-level modes - -# Modes we want: -# - "raw" : Output the parsed text export document with no further processing, as json -# - "tagged"? : Output the parsed result of the TagCompiler -# - "doc" : Generate a full panoply of PDF reports contextually based on tagging - - def dump_field_map(output=sys.stdout): from ptulsconv.docparser.tag_mapping import TagMapping from ptulsconv.docparser.adr_entity import ADRLine, GenericEvent diff --git a/ptulsconv/commands.py b/ptulsconv/commands.py index a877260..21204de 100644 --- a/ptulsconv/commands.py +++ b/ptulsconv/commands.py @@ -105,8 +105,8 @@ def generate_documents(session_tc_format, scenes, adr_lines: Iterator[ADRLine], output_continuity(scenes=scenes, tc_display_format=session_tc_format, title=title, client=client, supervisor=supervisor) - # reels = sorted([r for r in compiler.compile_all_time_spans() if r[0] == 'Reel'], - # key=lambda x: x[2]) + # reels = sorted([r for r in compiler.compile_all_time_spans() if r[0] == 'Reel'], + # key=lambda x: x[2]) reels = ['R1', 'R2', 'R3', 'R4', 'R5', 'R6'] if len(adr_lines) == 0: @@ -197,7 +197,7 @@ def convert(input_file, major_mode, output=sys.stdout, warnings=True): if warnings: perform_adr_validations(adr_lines) - generate_documents(session_tc_format, scenes, adr_lines, title, client) + generate_documents(session_tc_format, scenes, adr_lines, title) def perform_adr_validations(lines : Iterator[ADRLine]): diff --git a/ptulsconv/docparser/tag_compiler.py b/ptulsconv/docparser/tag_compiler.py index 6ae0bde..6051951 100644 --- a/ptulsconv/docparser/tag_compiler.py +++ b/ptulsconv/docparser/tag_compiler.py @@ -19,6 +19,10 @@ class Event: class TagCompiler: + """ + Uses a `SessionDescriptor` as a data source to produce `Intermediate` + items. + """ Intermediate = namedtuple('Intermediate', 'track_content track_tags track_comment_tags ' 'clip_content clip_tags clip_tag_mode start finish') @@ -26,6 +30,9 @@ class TagCompiler: session: doc_entity.SessionDescriptor def compile_all_time_spans(self) -> List[Tuple[str, str, Fraction, Fraction]]: + """ + :returns: A `List` of (key: str, value: str, start: Fraction, finish: Fraction) + """ ret_list = list() for element in self.parse_data(): if element.clip_tag_mode == TagPreModes.TIMESPAN: diff --git a/ptulsconv/pdf/continuity.py b/ptulsconv/pdf/continuity.py index 4cc4650..2828ae4 100644 --- a/ptulsconv/pdf/continuity.py +++ b/ptulsconv/pdf/continuity.py @@ -36,11 +36,11 @@ def table_for_scene(scene, tc_format, font_name = 'Helvetica'): def output_report(scenes: List[Tuple[str, str, Fraction, Fraction]], tc_display_format: TimecodeFormat, - title: str, client: str, supervisor): + title: str, client: str, supervisor, paper_size = letter): filename = "%s Continuity.pdf" % title document_header = "Continuity" - doc = make_doc_template(page_size=portrait(letter), + doc = make_doc_template(page_size=portrait(paper_size), filename=filename, document_title="Continuity", title=title,