X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fextension%2Fscript%2FInkscapePython.cpp;h=49e6a11a288789a8d35c499819b5ed5136b85348;hb=f6a2dd68517ddb25100f80a0b676930c5ee12aef;hp=eca09951aea1389d73216e8bb0787a52a62c2353;hpb=6b15695578f07a3f72c4c9475c1a261a3021472a;p=inkscape.git diff --git a/src/extension/script/InkscapePython.cpp b/src/extension/script/InkscapePython.cpp index eca09951a..49e6a11a2 100644 --- a/src/extension/script/InkscapePython.cpp +++ b/src/extension/script/InkscapePython.cpp @@ -37,7 +37,7 @@ InkscapePython::InkscapePython() { } - + /* * @@ -47,15 +47,15 @@ InkscapePython::~InkscapePython() } - - + + 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) { @@ -67,7 +67,7 @@ bool InkscapePython::interpretScript(Glib::ustring &script, PyRun_SimpleString(inkscape_module_script); PyRun_SimpleString("inkscape = _inkscape_py.getInkscape()\n"); PyRun_SimpleString(codeStr); - + //## Check for errors if (PyErr_Occurred()) { @@ -77,7 +77,7 @@ bool InkscapePython::interpretScript(Glib::ustring &script, PyErr_Fetch(&errobj, &errdata, &errtraceback); //PyErr_Clear(); - + if (errobj && PyString_Check(errobj)) { PyObject *pystring = PyObject_Str(errobj); @@ -98,8 +98,8 @@ bool InkscapePython::interpretScript(Glib::ustring &script, return true; } - - + +