mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2025-12-31 08:50:48 +00:00
Fixed bug in report generation fonts
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from ptulsconv.commands import convert, dump_field_map
|
||||
from ptulsconv import __name__, __version__, __author__
|
||||
from optparse import OptionParser, OptionGroup
|
||||
from .xml.common import dump_xform_options
|
||||
from .reporting import print_status_style, print_banner_style, print_section_header_style, print_fatal_error
|
||||
import datetime
|
||||
import sys
|
||||
@@ -100,7 +101,7 @@ def main():
|
||||
convert(input_file=args[1], output_format=output_format, start=options.in_time, end=options.out_time,
|
||||
include_muted=options.include_muted, xsl=options.xslt, select_reel=options.select_reel,
|
||||
progress=False, output=sys.stdout, log_output=sys.stderr,
|
||||
warnings=options.warnings, spelling=False)
|
||||
warnings=options.warnings)
|
||||
except FileNotFoundError as e:
|
||||
print_fatal_error("Error trying to read input file")
|
||||
raise e
|
||||
|
||||
@@ -143,13 +143,20 @@ def convert(input_file, output_format='fmpxml', start=None, end=None, select_ree
|
||||
json.dump(parsed, output)
|
||||
|
||||
elif output_format == 'full':
|
||||
output_line_count(parsed)
|
||||
print_section_header_style("Creating PDF Reports")
|
||||
|
||||
print_status_style("Creating ADR Report")
|
||||
output_summary(parsed)
|
||||
|
||||
print_status_style("Creating Line Count")
|
||||
output_line_count(parsed)
|
||||
|
||||
print_status_style("Creating Supervisor Logs directory and reports")
|
||||
os.makedirs("Supervisor Logs", exist_ok=True)
|
||||
os.chdir("Supervisor Logs")
|
||||
output_supervisor_1pg(parsed)
|
||||
|
||||
print_status_style("Creating Scripts directory and reports")
|
||||
os.chdir("..")
|
||||
os.makedirs("Talent Scripts", exist_ok=True)
|
||||
os.chdir("Talent Scripts")
|
||||
|
||||
@@ -5,6 +5,8 @@ import datetime
|
||||
from reportlab.platypus.doctemplate import BaseDocTemplate, PageTemplate
|
||||
from reportlab.platypus.frames import Frame
|
||||
|
||||
from reportlab.pdfbase import pdfmetrics
|
||||
from reportlab.pdfbase.ttfonts import TTFont
|
||||
|
||||
# This is from https://code.activestate.com/recipes/576832/ for
|
||||
# generating page count messages
|
||||
@@ -64,6 +66,7 @@ def make_doc_template(page_size, filename, document_title, record, document_head
|
||||
onPage=lambda c, _: draw_header_footer(c, title_box, report_box, footer_box, record,
|
||||
doc_title=document_header))
|
||||
|
||||
pdfmetrics.registerFont(TTFont('Futura', 'Futura.ttc'))
|
||||
doc = ADRDocTemplate(filename,
|
||||
title=document_title,
|
||||
author=record.get('Supervisor', ""),
|
||||
|
||||
Reference in New Issue
Block a user