version 1.34 | | version 1.35 |
---|
| | |
static PyObject* registerGEvent(PyObject* self, PyObject* args); | | static PyObject* registerGEvent(PyObject* self, PyObject* args); |
static PyObject* unregisterGEvent(PyObject* self, PyObject* args); | | static PyObject* unregisterGEvent(PyObject* self, PyObject* args); |
static PyObject* CFPythonError; | | static PyObject* CFPythonError; |
| | static PyObject* getTime(PyObject* self, PyObject* args); |
| | |
/** Set up an Python exception object. */ | | /** Set up an Python exception object. */ |
static void set_exception(const char *fmt, ...) | | static void set_exception(const char *fmt, ...) |
| | |
{"RegisterCommand", registerCommand, METH_VARARGS}, | | {"RegisterCommand", registerCommand, METH_VARARGS}, |
{"RegisterGlobalEvent", registerGEvent, METH_VARARGS}, | | {"RegisterGlobalEvent", registerGEvent, METH_VARARGS}, |
{"UnregisterGlobalEvent",unregisterGEvent, METH_VARARGS}, | | {"UnregisterGlobalEvent",unregisterGEvent, METH_VARARGS}, |
| | {"GetTime", getTime, METH_VARARGS}, |
{NULL, NULL, 0} | | {NULL, NULL, 0} |
}; | | }; |
| | |
| | |
return Py_None; | | return Py_None; |
} | | } |
| | |
| | static PyObject* getTime(PyObject* self, PyObject* args) |
| | { |
| | PyObject* list; |
| | partylist* party; |
| | timeofday_t tod; |
| | |
| | if (!PyArg_ParseTuple(args, "", NULL)) |
| | return NULL; |
| | |
| | cf_get_time(&tod); |
| | |
| | list = PyList_New(0); |
| | PyList_Append(list, Py_BuildValue("i",tod.year)); |
| | PyList_Append(list, Py_BuildValue("i",tod.month)); |
| | PyList_Append(list, Py_BuildValue("i",tod.day)); |
| | PyList_Append(list, Py_BuildValue("i",tod.hour)); |
| | PyList_Append(list, Py_BuildValue("i",tod.minute)); |
| | PyList_Append(list, Py_BuildValue("i",tod.dayofweek)); |
| | PyList_Append(list, Py_BuildValue("i",tod.weekofmonth)); |
| | PyList_Append(list, Py_BuildValue("i",tod.season)); |
| | |
| | return list; |
| | } |
| | |
void initContextStack() | | void initContextStack() |
{ | | { |
current_context = NULL; | | current_context = NULL; |