Exemple #1
0
	bool PMapping::DelItem(char* key) {
		if (!this->myObject) { throw new NULLPyObjectException(); }
		if (PyMapping_DelItemString(this->myObject, key) == -1) {
			return false;
		}
		return true;
	}
Exemple #2
0
static void set_float(int num, char const *name, PyObject *dict) {
	PyObject *value = PyMapping_GetItemString(dict, name);
	if (!value)
		return;
	PyMapping_DelItemString(dict, name);
	shmem->floats[num] = PyFloat_AsDouble(value);
	Py_DECREF(value);
}
Exemple #3
0
static PyObject *get_object(char const *name, PyObject *dict) {
	FUNCTION_START;
	PyObject *value = PyMapping_GetItemString(dict, name);
	if (!value) {
		debug("Requested object %s not found", name);
		return NULL;
	}
	PyMapping_DelItemString(dict, name);
	return value;
}
Exemple #4
0
static void set_int(int num, char const *name, PyObject *dict) {
	PyObject *value = PyMapping_GetItemString(dict, name);
	if (!value) {
		debug("not setting value for %s, which is not in the dict", name);
		return;
	}
	PyMapping_DelItemString(dict, name);
	shmem->ints[num] = PyLong_AsLong(value);
	Py_DECREF(value);
}