parameters: (self, origin=None, image_path=None)
docstring: Launch Image Occlusion Enhanced
docstring_summary: Launch Image Occlusion Enhanced
docstring_tokens: Launch Image Occlusion Enhanced
function: def onImgOccButton(self, origin=None, image_path=None):
      """Launch Image Occlusion Enhanced"""
      origin = origin or getEdParentInstance(self.parentWindow)
      io_model = getOrCreateModel()
      if io_model:
          io_model_fields = mw.col.models.fieldNames(io_model)
          if "imgocc" in mw.col.conf:
              dflt_fields = list(mw.col.conf['imgocc']['flds'].values())
          else:
              dflt_fields = list(IO_FLDS.values())
          # note type integrity check
          if not all(x in io_model_fields for x in dflt_fields):
              ioCritical("model_error", help="notetype",
                         parent=self.parentWindow)
              return False
      try:  # allows us to fall back to old image if necessary
          oldimg = self.imgoccadd.image_path
      except AttributeError:
          oldimg = None
      self.imgoccadd = ImgOccAdd(self, origin, oldimg)
      self.imgoccadd.occlude(image_path)
function_tokens: def onImgOccButton ( self , origin = None , image_path = None ) : origin = origin or getEdParentInstance ( self . parentWindow ) io_model = getOrCreateModel ( ) if io_model : io_model_fields = mw . col . models . fieldNames ( io_model ) if "imgocc" in mw . col . conf : dflt_fields = list ( mw . col . conf [ 'imgocc' ] [ 'flds' ] . values ( ) ) else : dflt_fields = list ( IO_FLDS . values ( ) ) # note type integrity check if not all ( x in io_model_fields for x in dflt_fields ) : ioCritical ( "model_error" , help = "notetype" , parent = self . parentWindow ) return False try : # allows us to fall back to old image if necessary oldimg = self . imgoccadd . image_path except AttributeError : oldimg = None self . imgoccadd = ImgOccAdd ( self , origin , oldimg ) self . imgoccadd . occlude ( image_path )