def showFile()

in scripts/yapl/Utilities.py [0:0]


def showFile(path):
  """
    The showFile() method opens the given file for reading and writes it out to stdout.  
    This is intended for use with help text files for scripts that want to show usage 
    information to the user.
  """
  if (not path):
    raise Exception("The given path for the file to show is empty or None.")
  #endIf
  
  try:
    fileToShow = open(path,"r")
    line = fileToShow.readline()
    while line:
      sys.stdout.write(line)
      sys.stdout.flush()
      line = fileToShow.readline()
    #endWhile
  except Exception as e:
    raise e