<s> from __future__ import unicode_literals <EOL> import frappe <EOL> def execute ( ) : <EOL> frappe . reload_doc ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> print_settings = frappe . get_doc ( "<STR_LIT>" ) <EOL> print_settings . print_style = "<STR_LIT>" <EOL> try : <EOL> import pdfkit <EOL> except ImportError : <EOL> pass <EOL> else : <EOL> outgoing_email_settings = frappe . db . get_singles_dict ( "<STR_LIT>" ) <EOL> if "<STR_LIT>" in outgoing_email_settings : <EOL> print_settings . send_print_as_pdf = outgoing_email_settings . send_print_as_pdf <EOL> print_settings . pdf_page_size = outgoing_email_settings . pdf_page_size <EOL> else : <EOL> print_settings . send_print_as_pdf = <NUM_LIT:1> <EOL> print_settings . save ( ) </s>
