Author: ArcRiley Date: 2009-01-18 11:43:04 -0500 (Sun, 18 Jan 2009) New Revision: 1496
Modified: trunk/concordance/src/sockets/Socket.c Log: now draws from local module - at a cost of code complexity Modified: trunk/concordance/src/sockets/Socket.c =================================================================== --- trunk/concordance/src/sockets/Socket.c 2009-01-18 16:20:45 UTC (rev 1495) +++ trunk/concordance/src/sockets/Socket.c 2009-01-18 16:43:04 UTC (rev 1496) @@ -38,14 +38,25 @@ /* Get context from global state + I am so sorry for this. Here's the natural language for this block: + 1) get a PyObject* for the concordance.sockets module object + 2) get the state of sockets module - a PyObject** to concordance._core + 3) dereference the PyObject** to PyObject* + 4) get the state of _core - a concordGlobals** + 5) dereference concordGlobals** to concordGlobals* + 6) copy the GMainContext* context from the struct to self->context + void* PyModule_GetState (PyObject*); */ self->cntx = (*(concordGlobals**) PyModule_GetState( - PyImport_ImportModule("concordance._core")))->context; + *(PyObject**) PyModule_GetState( + PyImport_ImportModule("concordance.sockets")) + ))->context; return (PyObject*) self; } + static int socketsSocket_init(PyObject* s, PyObject* args, PyObject* kwds) { /*\ cdef : \*/ _______________________________________________ PySoy-SVN mailing list PySoy-SVN@pysoy.org http://www.pysoy.org/mailman/listinfo/pysoy-svn