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: Test if given filename exists as a stream or a storage in the OLE
  container, and return its type.
  
  :param filename: path of stream in storage tree. (see openstream for syntax)
  :returns: False if object does not exist, its entry type (>0) otherwise:
  
      - STGTY_STREAM: a stream
      - STGTY_STORAGE: a storage
      - STGTY_ROOT: the root entry
docstr_tok: ["Test","if","given","filename","exists","as","a","stream","or","a","storage","in","the","OLE","container",",","and","return","its","type",".",":","param","filename",":","path","of","stream","in","storage","tree",".","(","see","openstream","for","syntax",")",":","returns",":","False","if","object","does","not","exist",",","its","entry","type","(",">","0",")","otherwise",":","-","STGTY_STREAM",":","a","stream","-","STGTY_STORAGE",":","a","storage","-","STGTY_ROOT",":","the","root","entry"]
code: def get_type(self, filename):
      """
      Test if given filename exists as a stream or a storage in the OLE
      container, and return its type.
  
      :param filename: path of stream in storage tree. (see openstream for syntax)
      :returns: False if object does not exist, its entry type (>0) otherwise:
  
          - STGTY_STREAM: a stream
          - STGTY_STORAGE: a storage
          - STGTY_ROOT: the root entry
      """
      try:
          sid = self._find(filename)
          entry = self.direntries[sid]
          return entry.entry_type
      except:
          return False
  
imports: from __future__ import print_function
  import io
  import sys
  import struct, array, os.path, datetime, logging
label_desc: Use image node_id 28 for calling the OleFileIO obj's underlying member method code with example usage: obj.get_type(filename) and returns: entry, False