version 1.12 | | version 1.13 |
---|
| | |
{ | | { |
if (!PyArg_ParseTuple(args,"",NULL)) | | if (!PyArg_ParseTuple(args,"",NULL)) |
return NULL; | | return NULL; |
| | if (!current_context->who) |
| | { |
| | Py_INCREF(Py_None); |
| | return Py_None; |
| | } |
| | Py_INCREF(current_context->who); |
return current_context->who; | | return current_context->who; |
} | | } |
static PyObject* getWhoIsActivator(PyObject* self, PyObject* args) | | static PyObject* getWhoIsActivator(PyObject* self, PyObject* args) |
{ | | { |
if (!PyArg_ParseTuple(args,"",NULL)) | | if (!PyArg_ParseTuple(args,"",NULL)) |
return NULL; | | return NULL; |
| | if (!current_context->activator) |
| | { |
| | Py_INCREF(Py_None); |
| | return Py_None; |
| | } |
| | Py_INCREF(current_context->activator); |
return current_context->activator; | | return current_context->activator; |
} | | } |
static PyObject* getWhoIsThird(PyObject* self, PyObject* args) | | static PyObject* getWhoIsThird(PyObject* self, PyObject* args) |
{ | | { |
if (!PyArg_ParseTuple(args,"",NULL)) | | if (!PyArg_ParseTuple(args,"",NULL)) |
return NULL; | | return NULL; |
| | if (!current_context->third) |
| | { |
| | Py_INCREF(Py_None); |
| | return Py_None; |
| | } |
| | Py_INCREF(current_context->third); |
return current_context->third; | | return current_context->third; |
} | | } |
static PyObject* getWhatIsMessage(PyObject* self, PyObject* args) | | static PyObject* getWhatIsMessage(PyObject* self, PyObject* args) |
| | |
va_end(args); | | va_end(args); |
context->returnvalue = 0; | | context->returnvalue = 0; |
| | |
Py_XINCREF(context->who); | | |
Py_XINCREF(context->activator); | | |
Py_XINCREF(context->third); | | |
| | |
scriptfile = fopen(context->script,"r"); | | scriptfile = fopen(context->script,"r"); |
if (scriptfile == NULL) | | if (scriptfile == NULL) |
{ | | { |
| | |
strcpy(context->options,va_arg(args, char*)); | | strcpy(context->options,va_arg(args, char*)); |
context->returnvalue = 0; | | context->returnvalue = 0; |
| | |
Py_XINCREF(context->who); | | |
Py_XINCREF(context->activator); | | |
Py_XINCREF(context->third); | | |
| | |
va_end(args); | | va_end(args); |
scriptfile = fopen(context->script,"r"); | | scriptfile = fopen(context->script,"r"); |
if (scriptfile == NULL) | | if (scriptfile == NULL) |