#NEWLINE# def get_title_page_story( screenplay ) : #NEWLINE# #INDENT# 'Get Platypus flowables for the title page\n\n    ' #NEWLINE# def add_lines( story , attribute , style , space_before = 0 ) : #NEWLINE# #INDENT# lines = screenplay . get_rich_attribute ( attribute ) #NEWLINE# if ( not lines ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# if space_before : #NEWLINE# #INDENT# story . append ( Spacer ( frame_width , space_before ) ) #NEWLINE# #UNINDENT# total_height = 0 #NEWLINE# for line in lines : #NEWLINE# #INDENT# html = line . to_html ( ) #NEWLINE# para = Paragraph ( html , style ) #NEWLINE# ( width , height ) = para . wrap ( frame_width , frame_height ) #NEWLINE# story . append ( para ) #NEWLINE# total_height += height #NEWLINE# #UNINDENT# return ( space_before + total_height ) #NEWLINE# #UNINDENT# title_story = [ ] #NEWLINE# title_height = sum ( ( add_lines ( title_story , 'Title' , title_style ) , add_lines ( title_story , 'Credit' , centered_style , space_before = 12 ) , add_lines ( title_story , 'Author' , centered_style ) , add_lines ( title_story , 'Authors' , centered_style ) , add_lines ( title_story , 'Source' , centered_style ) ) ) #NEWLINE# lower_story = [ ] #NEWLINE# lower_height = sum ( ( add_lines ( lower_story , 'Draft date' , default_style ) , add_lines ( lower_story , 'Contact' , contact_style , space_before = 12 ) , add_lines ( lower_story , 'Copyright' , centered_style , space_before = 12 ) ) ) #NEWLINE# if ( ( not title_story ) and ( not lower_story ) ) : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# story = [ ] #NEWLINE# top_space = min ( ( frame_height / 3.0 ) , ( ( frame_height - lower_height ) - title_height ) ) #NEWLINE# if ( top_space > 0 ) : #NEWLINE# #INDENT# story . append ( Spacer ( frame_width , top_space ) ) #NEWLINE# #UNINDENT# story += title_story #NEWLINE# middle_space = ( ( ( ( frame_height - top_space ) - title_height ) - lower_height ) - 6 ) #NEWLINE# if ( middle_space > 0 ) : #NEWLINE# #INDENT# story . append ( Spacer ( frame_width , middle_space ) ) #NEWLINE# #UNINDENT# story += lower_story #NEWLINE# story . append ( platypus . PageBreak ( ) ) #NEWLINE# return story