| 2967 | } |
| 2968 | |
| 2969 | static PyObject* setGearsSession(PyObject *cls, PyObject *args){ |
| 2970 | if(PyTuple_Size(args) != 1){ |
| 2971 | PyErr_SetString(GearsError, "Wrong number of args given to setGearsSession"); |
| 2972 | return NULL; |
| 2973 | } |
| 2974 | |
| 2975 | PythonThreadCtx* ptctx = GetPythonThreadCtx(); |
| 2976 | |
| 2977 | PyObject* s = PyTuple_GetItem(args, 0); |
| 2978 | if(s == Py_None){ |
| 2979 | ptctx->currSession = NULL; |
| 2980 | }else{ |
| 2981 | if(!PyObject_IsInstance((PyObject*)s, (PyObject*)&PyExecutionSessionType)){ |
| 2982 | PyErr_SetString(GearsError, "Given object is not of type GearsSession"); |
| 2983 | return NULL; |
| 2984 | } |
| 2985 | |
| 2986 | PyExecutionSession* pyExSes = (PyExecutionSession*)s; |
| 2987 | ptctx->currSession = pyExSes->s; |
| 2988 | ptctx->crtCtx = pyExSes->crtCtx; |
| 2989 | ptctx->commandCtx = pyExSes->cmdCtx; |
| 2990 | } |
| 2991 | |
| 2992 | Py_INCREF(Py_None); |
| 2993 | return Py_None; |
| 2994 | } |
| 2995 | |
| 2996 | static PyObject* gearsCtx(PyObject *cls, PyObject *args){ |
| 2997 | PythonThreadCtx* ptctx = GetPythonThreadCtx(); |
no test coverage detected