def fromPath(cls, path):
        """
        @param path: A path object to use for both reading contents from and
        later saving to.

        @type path: L{FilePath}
        """
        self = cls(path)
        try:
            fp = path.open()
        except __HOLE__:
            return self
        for line in fp:
            if line.startswith(HashedEntry.MAGIC):
                entry = HashedEntry.fromString(line)
            else:
                try:
                    entry = PlainEntry.fromString(line)
                except (DecodeError, InvalidEntry, BadKeyError):
                    entry = UnparsedEntry(line)
            self._entries.append(entry)
        return self
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/conch/client/knownhosts.py/KnownHostsFile.fromPath