Subversion Repositories Scribus

Compare Revisions

Regard whitespace Rev 11896 → Rev 11899

/trunk/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp
385,7 → 385,9
Calling all code in one command:
ia = code.InteractiveInterpreter() ia.runsource(getval())
works fine in plain Python. Not here. WTF? */
cm += ("import cStringIO\n"
cm += (
"try:\n"
" import cStringIO\n"
"scribus._bu = cStringIO.StringIO()\n"
"sys.stdout = scribus._bu\n"
"sys.stderr = scribus._bu\n"
394,7 → 396,12
" scribus._ia.push(i)\n"
"scribus.retval(scribus._bu.getvalue())\n"
"sys.stdout = sys.__stdout__\n"
"sys.stderr = sys.__stderr__\n");
" sys.stderr = sys.__stderr__\n"
"except SystemExit:\n"
" print 'Catched SystemExit - it is not good for Scribus'\n"
"except KeyboardInterrupt:\n"
" print 'Catched KeyboardInterrupt - it is not good for Scribus'\n"
);
}
// Set up sys.argv
/* PV - WARNING: THIS IS EVIL! This code summons a crash - see
424,6 → 431,9
"command you entered. Details were printed to "
"stderr. ") + "</qt>");
}
else
// Because 'result' may be NULL, not a PyObject*, we must call PyXDECREF not Py_DECREF
Py_XDECREF(result);
}
ScCore->primaryMainWindow()->ScriptRunning = false;
}