parameters: (filename, commentPrefix='#', unicode_=True, lowercase=False, unique=False)
return_statement: return retVal if not unique else retVal.keys()
docstring: Returns newline delimited items contained inside file
docstring_summary: Returns newline delimited items contained inside file
docstring_tokens: Returns newline delimited items contained inside file
function: def getFileItems(filename, commentPrefix='#', unicode_=True, lowercase=False, unique=False):
      """
      Returns newline delimited items contained inside file
      """
  
      retVal = list() if not unique else OrderedDict()
  
      checkFile(filename)
  
      try:
          with openFile(filename, 'r', errors="ignore") if unicode_ else open(filename, 'r') as f:
              for line in (f.readlines() if unicode_ else f.xreadlines()):  # xreadlines doesn't return unicode strings when codec.open() is used
                  if commentPrefix:
                      if line.find(commentPrefix) != -1:
                          line = line[:line.find(commentPrefix)]
  
                  line = line.strip()
  
                  if not unicode_:
                      try:
                          line = str.encode(line)
                      except UnicodeDecodeError:
                          continue
  
                  if line:
                      if lowercase:
                          line = line.lower()
  
                      if unique and line in retVal:
                          continue
  
                      if unique:
                          retVal[line] = True
                      else:
                          retVal.append(line)
      except (IOError, OSError, MemoryError), ex:
          errMsg = "something went wrong while trying "
          errMsg += "to read the content of file '%s' ('%s')" % (filename, ex)
          raise SqlmapSystemException(errMsg)
  
      return retVal if not unique else retVal.keys()
function_tokens: def getFileItems ( filename , commentPrefix = '#' , unicode_ = True , lowercase = False , unique = False ) : retVal = list ( ) if not unique else OrderedDict ( ) checkFile ( filename ) try : with openFile ( filename , 'r' , errors = "ignore" ) if unicode_ else open ( filename , 'r' ) as f : for line in ( f . readlines ( ) if unicode_ else f . xreadlines ( ) ) : # xreadlines doesn't return unicode strings when codec.open() is used if commentPrefix : if line . find ( commentPrefix ) != - 1 : line = line [ : line . find ( commentPrefix ) ] line = line . strip ( ) if not unicode_ : try : line = str . encode ( line ) except UnicodeDecodeError : continue if line : if lowercase : line = line . lower ( ) if unique and line in retVal : continue if unique : retVal [ line ] = True else : retVal . append ( line ) except ( IOError , OSError , MemoryError ) , ex : errMsg = "something went wrong while trying " errMsg += "to read the content of file '%s' ('%s')" % ( filename , ex ) raise SqlmapSystemException ( errMsg ) return retVal if not unique else retVal . keys ( )