summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLieuwe <lieuwemo@gmail.com>2011-03-03 20:12:57 (GMT)
committer Lieuwe <lieuwemo@gmail.com>2011-03-03 20:12:57 (GMT)
commitfc70b5bb783ff90865f35f20edb8436a8fb7dc40 (patch)
tree040d2affaee939cd4e544c928e7f658c73f30f37 /src
parenteab871c77487714cab68b9e4753a2bcf7ece79f4 (diff)
downloadpowder-fc70b5bb783ff90865f35f20edb8436a8fb7dc40.zip
powder-fc70b5bb783ff90865f35f20edb8436a8fb7dc40.tar.gz
tpt_console.py now internal
Diffstat (limited to 'src')
-rw-r--r--src/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index e333830..a793a7b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -24,6 +24,8 @@
*/
#include "Python.h"
+#include "pyconsole.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1828,11 +1830,13 @@ int main(int argc, char *argv[])
PyRun_SimpleString("import sys\nsys.path.append('.')");
PyRun_SimpleString("print 'python present.'");
//load the console module and whatnot
- pname=PyString_FromString("tpt_console");//create string object
- pmodule = PyImport_Import(pname);//import module
+ //pname=PyString_FromString("tpt_console");//create string object
+ //pmodule = PyImport_Import(pname);//import module
+ PyObject *tpt_console_obj = PyMarshal_ReadObjectFromString(tpt_console_pyc+8, sizeof(tpt_console_pyc)-8);
+ pmodule=PyImport_ExecCodeModule("tpt_console", tpt_console_obj);
if(pmodule!=NULL)
{
- Py_DECREF(pname);//throw away the string object
+ //Py_DECREF(pname);//throw away the string object
pfunc=PyObject_GetAttrString(pmodule,"handle");//get the handler function
if(pfunc && PyCallable_Check(pfunc))//check if it's really a function
{