mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2025-12-31 08:50:48 +00:00
Refactoring
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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]):
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user