index eca09951aea1389d73216e8bb0787a52a62c2353..49e6a11a288789a8d35c499819b5ed5136b85348 100644 (file)
{
}
{
}
-
+
/*
*
/*
*
}
}
-
-
+
+
static bool initialized = false;
/*
* Interpret an in-memory string
*/
static bool initialized = false;
/*
* Interpret an in-memory string
*/
-bool InkscapePython::interpretScript(Glib::ustring &script,
- Glib::ustring &output,
- Glib::ustring &error)
+bool InkscapePython::interpretScript(const Glib::ustring &script,
+ Glib::ustring &output,
+ Glib::ustring &error)
{
if (!initialized)
{
{
if (!initialized)
{
PyRun_SimpleString(inkscape_module_script);
PyRun_SimpleString("inkscape = _inkscape_py.getInkscape()\n");
PyRun_SimpleString(codeStr);
PyRun_SimpleString(inkscape_module_script);
PyRun_SimpleString("inkscape = _inkscape_py.getInkscape()\n");
PyRun_SimpleString(codeStr);
-
+
//## Check for errors
if (PyErr_Occurred())
{
//## Check for errors
if (PyErr_Occurred())
{
PyErr_Fetch(&errobj, &errdata, &errtraceback);
//PyErr_Clear();
PyErr_Fetch(&errobj, &errdata, &errtraceback);
//PyErr_Clear();
-
+
if (errobj && PyString_Check(errobj))
{
PyObject *pystring = PyObject_Str(errobj);
if (errobj && PyString_Check(errobj))
{
PyObject *pystring = PyObject_Str(errobj);
return true;
}
return true;
}
-
-
+
+