code: def createRtiFromFileName(fileName):
      
      cls, rtiRegItem = detectRtiFromFileName(fileName)
      if cls is None:
          logger.warn("Unable to import plugin {}: {}"
                      .format(rtiRegItem.fullName, rtiRegItem.exception))
          rti = UnknownFileRti.createFromFileName(fileName)
          rti.setException(rtiRegItem.exception)
      else:
          rti = cls.createFromFileName(fileName)
  
      assert rti, "Sanity check failed (createRtiFromFileName). Please report this bug."
      return rti
docs: Determines the type of RepoTreeItem to use given a file name and creates it.
          Uses a DirectoryRti for directories and an UnknownFileRti if the file
          extension doesn't match one of the registered RTI extensions.