def from_file(pkg_file):
        """
        Return a |PackageReader| instance loaded with contents of *pkg_file*.
        """
        phys_reader = PhysPkgReader(pkg_file)
        content_types = _ContentTypeMap.from_xml(phys_reader.content_types_xml)
        pkg_srels = PackageReader._srels_for(phys_reader, PACKAGE_URI)
        sparts = PackageReader._load_serialized_parts(
            phys_reader, pkg_srels, content_types
        )
        phys_reader.close()
        return PackageReader(content_types, pkg_srels, sparts)
def from_file ( pkg_file ) : phys_reader = PhysPkgReader ( pkg_file ) content_types = _ContentTypeMap . from_xml ( phys_reader . content_types_xml ) pkg_srels = PackageReader . _srels_for ( phys_reader , PACKAGE_URI ) sparts = PackageReader . _load_serialized_parts ( phys_reader , pkg_srels , content_types ) phys_reader . close ( ) return PackageReader ( content_types , pkg_srels , sparts )
Return a |PackageReader| instance loaded with contents of *pkg_file*.