MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / push

Method push

src/Gui/PythonConsole.cpp:375–400  ·  view source on GitHub ↗

* Store the line into the internal buffer and compile the total buffer. * In case it is a complete Python command the buffer is emptied. */

Source from the content-addressed store, hash-verified

373 * In case it is a complete Python command the buffer is emptied.
374 */
375bool InteractiveInterpreter::push(const char* line)
376{
377 d->buffer.append(QString::fromUtf8(line));
378 QString source = d->buffer.join(QLatin1String("\n"));
379 try {
380 bool more = runSource(source.toUtf8());
381 if (!more) {
382 d->buffer.clear();
383 }
384 return more;
385 }
386 catch (const Base::SystemExitException&) {
387 d->buffer.clear();
388 throw;
389 }
390 catch (...) {
391 // indication of unhandled exception
392 d->buffer.clear();
393 if (PyErr_Occurred()) {
394 PyErr_Print();
395 }
396 throw;
397 }
398
399 return false;
400}
401
402bool InteractiveInterpreter::hasPendingInput() const
403{

Callers 15

getInListExMethod · 0.45
getInListExPropMethod · 0.45
startElementMethod · 0.45
KDTreeClass · 0.45
ForceLegalMethod · 0.45
CreateEdgeMethod · 0.45
ExecuteMethod · 0.45
AddPathMethod · 0.45
InsertScanlineMethod · 0.45
CapturerMethod · 0.45
Writer.cppFile · 0.45
create_base64_encoderFunction · 0.45

Calls 3

appendMethod · 0.45
joinMethod · 0.45
clearMethod · 0.45

Tested by 1

CapturerMethod · 0.36