class_docstr: OLE container object
  
  This class encapsulates the interface to an OLE 2 structured
  storage file.  Use the listdir and openstream methods to
  access the contents of this file.
  
  Object names are given as a list of strings, one for each subentry
  level.  The root entry should be omitted.  For example, the following
  code extracts all image streams from a Microsoft Image Composer file::
  
      ole = OleFileIO("fan.mic")
  
      for entry in ole.listdir():
          if entry[1:2] == "Image":
              fin = ole.openstream(entry)
              fout = open(entry[0:1], "wb")
              while True:
                  s = fin.read(8192)
                  if not s:
                      break
                  fout.write(s)
  
  You can use the viewer application provided with the Python Imaging
  Library to view the resulting files (which happens to be standard
  TIFF files).
class_docstr_tok: ["OLE","container","object","This","class","encapsulates","the","interface","to","an","OLE","2","structured","storage","file",".","Use","the","listdir","and","openstream","methods","to","access","the","contents","of","this","file",".","Object","names","are","given","as","a","list","of","strings",",","one","for","each","subentry","level",".","The","root","entry","should","be","omitted",".","For","example",",","the","following","code","extracts","all","image","streams","from","a","Microsoft","Image","Composer","file",":",":","ole","=","OleFileIO","(","``","fan.mic","''",")","for","entry","in","ole.listdir","(",")",":","if","entry","[","1:2","]","==","``","Image","''",":","fin","=","ole.openstream","(","entry",")","fout","=","open","(","entry","[","0:1","]",",","``","wb","''",")","while","True",":","s","=","fin.read","(","8192",")","if","not","s",":","break","fout.write","(","s",")","You","can","use","the","viewer","application","provided","with","the","Python","Imaging","Library","to","view","the","resulting","files","(","which","happens","to","be","standard","TIFF","files",")","."]
docstr: Load the MiniFAT table.
docstr_tok: ["Load","the","MiniFAT","table","."]
code: def loadminifat(self):
      """
      Load the MiniFAT table.
      """
      # MiniFAT is stored in a standard  sub-stream, pointed to by a header
      # field.
      # NOTE: there are two sizes to take into account for this stream:
      # 1) Stream size is calculated according to the number of sectors
      #    declared in the OLE header. This allocated stream may be more than
      #    needed to store the actual sector indexes.
      # (self.num_mini_fat_sectors is the number of sectors of size self.sector_size)
      stream_size = self.num_mini_fat_sectors * self.sector_size
      # 2) Actually used size is calculated by dividing the MiniStream size
      #    (given by root entry size) by the size of mini sectors, *4 for
      #    32 bits indexes:
      nb_minisectors = (
          self.root.size + self.mini_sector_size - 1
      ) // self.mini_sector_size
      used_size = nb_minisectors * 4
      log.debug(
          "loadminifat(): minifatsect=%d, nb FAT sectors=%d, used_size=%d, stream_size=%d, nb MiniSectors=%d"
          % (
              self.minifatsect,
              self.num_mini_fat_sectors,
              used_size,
              stream_size,
              nb_minisectors,
          )
      )
      if used_size > stream_size:
          # This is not really a problem, but may indicate a wrong implementation:
          self._raise_defect(
              DEFECT_INCORRECT, "OLE MiniStream is larger than MiniFAT"
          )
      # In any case, first read stream_size:
      s = self._open(
          self.minifatsect, stream_size, force_FAT=True
      ).read()
      # [PL] Old code replaced by an array:
      # self.minifat = [i32(s, i) for i in range(0, len(s), 4)]
      self.minifat = self.sect2array(s)
      # Then shrink the array to used size, to avoid indexes out of MiniStream:
      log.debug(
          "MiniFAT shrunk from %d to %d sectors"
          % (len(self.minifat), nb_minisectors)
      )
      self.minifat = self.minifat[:nb_minisectors]
      log.debug("loadminifat(): len=%d" % len(self.minifat))
      # Display the FAT contents only if the logging level is debug:
      if log.isEnabledFor(logging.DEBUG):
          log.debug("\nMiniFAT:")
          self.dumpfat(self.minifat)
  
imports: from __future__ import print_function
  import io
  import sys
  import struct, array, os.path, datetime, logging
label_desc: Use image node_id 14 for calling the OleFileIO obj's underlying member method code with example usage: obj.loadminifat() without return types