def add_attachments(name, attachments):
 from frappe.utils.file_manager import save_url
 for a in attachments:
  if isinstance(a, basestring):
   attach = frappe.db.get_value(u'File', {u'name': a}, [u'file_name', u'file_url', u'is_private'], as_dict=1)
   save_url(attach.file_url, attach.file_name, u'Communication', name, u'Home/Attachments', attach.is_private)

def add_attachments ( name , attachments ) : from frappe . utils . file_manager import save_url for a in attachments : if isinstance ( a , basestring ) : attach = frappe . db . get_value ( u'File' , { u'name' : a } , [ u'file_name' , u'file_url' , u'is_private' ] , as_dict = 1 ) save_url ( attach . file_url , attach . file_name , u'Communication' , name , u'Home/Attachments' , attach . is_private )
add attachments to the given communiction .