#NEWLINE# def get_soup_head_body_and_scripts( app ) : #NEWLINE# #INDENT# with open ( get_main_html_file_path ( app ) , 'r' ) as f : #NEWLINE# #INDENT# html = f . read ( ) #NEWLINE# #UNINDENT# s = BeautifulSoup ( html ) #NEWLINE# if ( not s . html . head ) : #NEWLINE# #INDENT# s . html . insert ( 0 , s . new_tag ( 'head' ) ) #NEWLINE# #UNINDENT# head = s . html . head #NEWLINE# script = s . new_tag ( 'script' ) #NEWLINE# s . html . append ( script ) #NEWLINE# if ( not s . html . body ) : #NEWLINE# #INDENT# s . html . append ( s . new_tag ( 'body' ) ) #NEWLINE# #UNINDENT# body = s . html . body #NEWLINE# return ( s , head , body , script )