def get_attach_link(doc, print_format):
 return frappe.get_template(u'templates/emails/print_link.html').render({u'url': get_url(), u'doctype': doc.reference_doctype, u'name': doc.reference_name, u'print_format': print_format, u'key': doc.get_parent_doc().get_signature()})

def get_attach_link ( doc , print_format ) : return frappe . get_template ( u'templates/emails/print_link.html' ) . render ( { u'url' : get_url ( ) , u'doctype' : doc . reference_doctype , u'name' : doc . reference_name , u'print_format' : print_format , u'key' : doc . get_parent_doc ( ) . get_signature ( ) } )
returns public link for the attachment via templates/emails/print_link .