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: Adds the indexes of the given sector to the FAT
  
  :param sect: string containing the first FAT sector, or array of long integers
  :returns: index of last FAT sector.
docstr_tok: ["Adds","the","indexes","of","the","given","sector","to","the","FAT",":","param","sect",":","string","containing","the","first","FAT","sector",",","or","array","of","long","integers",":","returns",":","index","of","last","FAT","sector","."]
code: def loadfat_sect(self, sect):
      """
      Adds the indexes of the given sector to the FAT
  
      :param sect: string containing the first FAT sector, or array of long integers
      :returns: index of last FAT sector.
      """
      # a FAT sector is an array of ulong integers.
      if isinstance(sect, array.array):
          # if sect is already an array it is directly used
          fat1 = sect
      else:
          # if it's a raw sector, it is parsed in an array
          fat1 = self.sect2array(sect)
          # Display the sector contents only if the logging level is debug:
          if log.isEnabledFor(logging.DEBUG):
              self.dumpsect(sect)
      # The FAT is a sector chain starting at the first index of itself.
      # initialize isect, just in case:
      isect = None
      for isect in fat1:
          isect = isect & 0xFFFFFFFF  # JYTHON-WORKAROUND
          log.debug("isect = %X" % isect)
          if isect == ENDOFCHAIN or isect == FREESECT:
              # the end of the sector chain has been reached
              log.debug("found end of sector chain")
              break
          # read the FAT sector
          s = self.getsect(isect)
          # parse it as an array of 32 bits integers, and add it to the
          # global FAT array
          nextfat = self.sect2array(s)
          self.fat = self.fat + nextfat
      return isect
  
imports: from __future__ import print_function
  import io
  import sys
  import struct, array, os.path, datetime, logging
label_desc: Use image node_id 12 for calling the OleFileIO obj's underlying member method code with example usage: obj.loadfat_sect(sect) and returns: isect