MCPcopy Create free account
hub / github.com/Sigil-Ebook/Sigil / SetupInitialFunctionSearchEnvInPython

Method SetupInitialFunctionSearchEnvInPython

src/EmbedPython/PythonRoutines.cpp:445–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443
444
445PyObjectPtr PythonRoutines::SetupInitialFunctionSearchEnvInPython(const QString& function_name)
446{
447 int rv = 0;
448 PyObjectPtr FSO;
449 QString traceback;
450 QString jsonpath = Utility::DefinePrefsDir() + "/" + SIGIL_FUNCTION_REPLACE_JSON_FILE;
451 QString metaxml = Utility::GetMainWindowMetadata();
452 QString module = "functionsearch";
453 QList<QVariant> args;
454 args.append(QVariant(metaxml));
455 args.append(QVariant(function_name));
456 args.append(QVariant(jsonpath));
457 EmbeddedPython* epp = EmbeddedPython::instance();
458 QVariant res = epp->runInPython(module, QString("getFunctionSearchEnv"), args, &rv, traceback, true);
459 if (rv) {
460 fprintf(stderr, "getFunctionSearchEnv error %d traceback %s\n",rv, traceback.toStdString().c_str());
461 return FSO;
462 }
463 FSO = PyObjectPtr(res);
464 args.clear();
465 return FSO;
466}
467
468
469QString PythonRoutines::DoFunctionSearchTextReplacementsInPython(PyObjectPtr FSO,

Callers 4

replaceTextMethod · 0.80
CreateTableMethod · 0.80
CreateTableMethod · 0.80

Calls 5

appendMethod · 0.80
runInPythonMethod · 0.80
clearMethod · 0.80
QStringClass · 0.70
PyObjectPtrClass · 0.70

Tested by

no test coverage detected