parameters: (self, obj, arg2=None)
return_statement: return True
docstring: Called by the view provider, there doesn't seem to be a callback on the obj itself.
docstring_summary: Called by the view provider, there doesn't seem to be a callback on the obj itself.
docstring_tokens: Called by the view provider there doesn t seem to be a callback on the obj itself .
function: def onDelete(self, obj, arg2=None):
          """Called by the view provider, there doesn't seem to be a callback on the obj itself."""
          PathLog.track(obj.Label, arg2)
          doc = obj.Document
  
          if getattr(obj, "Operations", None):
              # the first to tear down are the ops, they depend on other resources
              PathLog.debug(
                  "taking down ops: %s" % [o.Name for o in self.allOperations()]
              )
              while obj.Operations.Group:
                  op = obj.Operations.Group[0]
                  if (
                      not op.ViewObject
                      or not hasattr(op.ViewObject.Proxy, "onDelete")
                      or op.ViewObject.Proxy.onDelete(op.ViewObject, ())
                  ):
                      PathUtil.clearExpressionEngine(op)
                      doc.removeObject(op.Name)
              obj.Operations.Group = []
              doc.removeObject(obj.Operations.Name)
              obj.Operations = None
  
          # stock could depend on Model, so delete it first
          if getattr(obj, "Stock", None):
              PathLog.debug("taking down stock")
              PathUtil.clearExpressionEngine(obj.Stock)
              doc.removeObject(obj.Stock.Name)
              obj.Stock = None
  
          # base doesn't depend on anything inside job
          if getattr(obj, "Model", None):
              for base in obj.Model.Group:
                  PathLog.debug("taking down base %s" % base.Label)
                  self.removeBase(obj, base, False)
              obj.Model.Group = []
              doc.removeObject(obj.Model.Name)
              obj.Model = None
  
          # Tool controllers might refer to either legacy tool or toolbit
          if getattr(obj, "Tools", None):
              PathLog.debug("taking down tool controller")
              for tc in obj.Tools.Group:
                  if hasattr(tc.Tool, "Proxy"):
                      PathUtil.clearExpressionEngine(tc.Tool)
                      doc.removeObject(tc.Tool.Name)
                  PathUtil.clearExpressionEngine(tc)
                  tc.Proxy.onDelete(tc)
                  doc.removeObject(tc.Name)
              obj.Tools.Group = []
              doc.removeObject(obj.Tools.Name)
              obj.Tools = None
  
          # SetupSheet
          if getattr(obj, "SetupSheet", None):
              PathUtil.clearExpressionEngine(obj.SetupSheet)
              doc.removeObject(obj.SetupSheet.Name)
              obj.SetupSheet = None
  
          return True
function_tokens: def onDelete ( self , obj , arg2 = None ) : PathLog . track ( obj . Label , arg2 ) doc = obj . Document if getattr ( obj , "Operations" , None ) : # the first to tear down are the ops, they depend on other resources PathLog . debug ( "taking down ops: %s" % [ o . Name for o in self . allOperations ( ) ] ) while obj . Operations . Group : op = obj . Operations . Group [ 0 ] if ( not op . ViewObject or not hasattr ( op . ViewObject . Proxy , "onDelete" ) or op . ViewObject . Proxy . onDelete ( op . ViewObject , ( ) ) ) : PathUtil . clearExpressionEngine ( op ) doc . removeObject ( op . Name ) obj . Operations . Group = [ ] doc . removeObject ( obj . Operations . Name ) obj . Operations = None # stock could depend on Model, so delete it first if getattr ( obj , "Stock" , None ) : PathLog . debug ( "taking down stock" ) PathUtil . clearExpressionEngine ( obj . Stock ) doc . removeObject ( obj . Stock . Name ) obj . Stock = None # base doesn't depend on anything inside job if getattr ( obj , "Model" , None ) : for base in obj . Model . Group : PathLog . debug ( "taking down base %s" % base . Label ) self . removeBase ( obj , base , False ) obj . Model . Group = [ ] doc . removeObject ( obj . Model . Name ) obj . Model = None # Tool controllers might refer to either legacy tool or toolbit if getattr ( obj , "Tools" , None ) : PathLog . debug ( "taking down tool controller" ) for tc in obj . Tools . Group : if hasattr ( tc . Tool , "Proxy" ) : PathUtil . clearExpressionEngine ( tc . Tool ) doc . removeObject ( tc . Tool . Name ) PathUtil . clearExpressionEngine ( tc ) tc . Proxy . onDelete ( tc ) doc . removeObject ( tc . Name ) obj . Tools . Group = [ ] doc . removeObject ( obj . Tools . Name ) obj . Tools = None # SetupSheet if getattr ( obj , "SetupSheet" , None ) : PathUtil . clearExpressionEngine ( obj . SetupSheet ) doc . removeObject ( obj . SetupSheet . Name ) obj . SetupSheet = None return True