2009-01-30 Al Riddoch <alriddoch@googlemail.com>

* rulesets/Python_API.cpp, rulesets/Python_API.h: Hack in a quick
	  function for executing python commands.

	* server/CommPythonClient.cpp: Pass input from the client straight
	  into the python interpretter and see what happens.
This commit is contained in:
Al Riddoch 2009-01-30 01:39:06 +00:00
parent ac7665e3c0
commit 0bbbfe7dae
4 changed files with 27 additions and 1 deletions

View file

@ -1153,3 +1153,16 @@ void shutdown_python_api()
Py_Finalize();
}
void run_python_command(const char * s)
{
static PyObject * context = 0;
if (context == 0) {
context = PyDict_New();
PyDict_SetItemString(context, "__builtins__", PyEval_GetBuiltins() );
}
PyRun_String(s, Py_single_input, context, context);
}