Ejemplo n.º 1
0
//-------------------------------------------------------------------------------------
void Base::destroyCellData(void)
{
	// cellDataDict_ 继续保留, 以供备份时使用, 这里仅仅让脚步层无法访问到即可
	// S_RELEASE(cellDataDict_);
	if(PyObject_DelAttrString(this, "cellData") == -1)
	{
		ERROR_MSG(fmt::format("{}::destroyCellData: delete cellData error!\n", this->scriptName()));
		SCRIPT_ERROR_CHECK();
	}
}
Ejemplo n.º 2
0
//-------------------------------------------------------------------------------------
void Base::destroyCellData(void)
{
	// cellDataDict_ 继续保留, 以供备份时使用, 这里仅仅让脚步层无法访问到即可
	// S_RELEASE(cellDataDict_);
	if(PyObject_DelAttrString(this, "cellData") == -1)
	{
		ERROR_MSG("Base::destroyCellData: del property cellData is error!\n");
		SCRIPT_ERROR_CHECK();
	}
}
Ejemplo n.º 3
0
 void idaapi closed()
 {
   if ( (cb_flags & CHOOSE_HAVE_ONCLOSE) == 0 )
   {
     chobj->chooser_base_t::closed();
     return;
   }
   PYW_GIL_GET;
   pycall_res_t pyres(
           PyObject_CallMethod(self, (char *)S_ON_CLOSE, NULL));
   // delete UI hook
   PyObject_DelAttrString(self, "ui_hooks_trampoline");
 }
Ejemplo n.º 4
0
static PyObject *
__finish_dcd_write(PyObject *self, PyObject *args)
{
  //PyObject* temp;
  //dcdhandle *dcd;

  if (! self) {
    /* we were in fact called as a module function, try to retrieve
       a matching object from args */
    if( !PyArg_ParseTuple(args, "O", &self) )
      return NULL;
  } else {
    /* we were obviously called as an object method so args should
       only have the int value. */
    if( !PyArg_ParseTuple(args, "") )
      return NULL;
  }

  /*if ( !PyObject_HasAttrString(self, "_dcd_C_ptr") ) {
  // Raise exception
  PyErr_SetString(PyExc_AttributeError, "_dcd_C_ptr is not an attribute");
  return NULL;
  }

  if ((temp = PyObject_GetAttrString(self, "_dcd_C_ptr")) == NULL) { // This gives me a New Reference
  // Raise exception
  PyErr_SetString(PyExc_AttributeError, "_dcd_C_ptr is not an attribute");
  return NULL;
  }
  dcd = (dcdhandle*)PyCObject_AsVoidPtr(temp);
  free(dcd);
  Py_DECREF(temp);*/

  if ( PyObject_DelAttrString(self, "_dcd_C_ptr") == -1) {
    // Raise exception
    PyErr_SetString(PyExc_AttributeError, "_dcd_C_ptr is not an attribute");
    return NULL;
  }

  Py_INCREF(Py_None);
  return Py_None;
}
Ejemplo n.º 5
0
 void DelAttr (const std::string& name)
 {
     if(PyObject_DelAttrString (Get(), const_cast<char*>(name.c_str())) == -1) {
         throw CAttributeError("DelAttr failed");
     }
 }
Ejemplo n.º 6
0
//-------------------------------------------------------------------------------------
int Script::unregisterToModule(const char* attrName)
{
	return PyObject_DelAttrString(module_, attrName);
}