def get_file_path(file_name):
 f = frappe.db.sql(u'select file_url from `tabFile`\n DCTB  DCTB where name=%s or file_name=%s', (file_name, file_name))
 if f:
  file_name = f[0][0]
 file_path = file_name
 if (u'/' not in file_path):
  file_path = (u'/files/' + file_path)
 if file_path.startswith(u'/private/files/'):
  file_path = get_files_path(is_private=1, *file_path.split(u'/private/files/', 1)[1].split(u'/'))
 elif file_path.startswith(u'/files/'):
  file_path = get_files_path(*file_path.split(u'/files/', 1)[1].split(u'/'))
 else:
  frappe.throw(_(u'There is some problem with the file url: {0}').format(file_path))
 return file_path

def get_file_path ( file_name ) : f = frappe . db . sql ( u'select file_url from `tabFile`\n DCTB  DCTB where name=%s or file_name=%s' , ( file_name , file_name ) ) if f : file_name = f [ 0 ] [ 0 ] file_path = file_name if ( u'/' not in file_path ) : file_path = ( u'/files/' + file_path ) if file_path . startswith ( u'/private/files/' ) : file_path = get_files_path ( is_private = 1 , * file_path . split ( u'/private/files/' , 1 ) [ 1 ] . split ( u'/' ) ) elif file_path . startswith ( u'/files/' ) : file_path = get_files_path ( * file_path . split ( u'/files/' , 1 ) [ 1 ] . split ( u'/' ) ) else : frappe . throw ( _ ( u'There is some problem with the file url: {0}' ) . format ( file_path ) ) return file_path
get file path from augeas_vhost_path .