| 443 | |
| 444 | |
| 445 | PyObjectPtr 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 | |
| 469 | QString PythonRoutines::DoFunctionSearchTextReplacementsInPython(PyObjectPtr FSO, |
no test coverage detected