class_docstr: Class for embedding a local file link in an IPython session, based on path
  
  e.g. to embed a link that was generated in the IPython notebook as my/data.txt
  
  you would do::
  
      local_file = FileLink("my/data.txt")
      display(local_file)
  
  or in the HTML notebook, just::
  
      FileLink("my/data.txt")
class_docstr_tok: ["Class","for","embedding","a","local","file","link","in","an","IPython","session",",","based","on","path","e.g",".","to","embed","a","link","that","was","generated","in","the","IPython","notebook","as","my\/data.txt","you","would","do",":",":","local_file","=","FileLink","(","``","my\/data.txt","''",")","display","(","local_file",")","or","in","the","HTML","notebook",",","just",":",":","FileLink","(","``","my\/data.txt","''",")"]
docstr: Parameters
  ----------
  path : str
      path to the file or directory that should be formatted
  url_prefix : str
      prefix to be prepended to all files to form a working link [default:
      '']
  result_html_prefix : str
      text to append to beginning to link [default: '']
  result_html_suffix : str
      text to append at the end of link [default: '<br>']
docstr_tok: ["Parameters","--","--","--","--","--","path",":","str","path","to","the","file","or","directory","that","should","be","formatted","url_prefix",":","str","prefix","to","be","prepended","to","all","files","to","form","a","working","link","[","default",":","``","]","result_html_prefix",":","str","text","to","append","to","beginning","to","link","[","default",":","``","]","result_html_suffix",":","str","text","to","append","at","the","end","of","link","[","default",":","'","<","br",">","'","]"]
code: def __init__(
      self,
      path,
      url_prefix="",
      result_html_prefix="",
      result_html_suffix="<br>",
  ):
      """
      Parameters
      ----------
      path : str
          path to the file or directory that should be formatted
      url_prefix : str
          prefix to be prepended to all files to form a working link [default:
          '']
      result_html_prefix : str
          text to append to beginning to link [default: '']
      result_html_suffix : str
          text to append at the end of link [default: '<br>']
      """
      if isdir(path):
          raise ValueError(
              "Cannot display a directory using FileLink. "
              "Use FileLinks to display '%s'." % path
          )
      self.path = path
      self.url_prefix = url_prefix
      self.result_html_prefix = result_html_prefix
      self.result_html_suffix = result_html_suffix
  
imports: from os.path import exists, isfile, splitext, abspath, join, isdir
  from os import walk, sep
  from IPython.core.display import DisplayObject
label_desc: Use image node_id 1 to create a new FileLink object from inherited base classes: object with example: obj = FileLink(path, url_prefix, result_html_prefix, result_html_suffix)