MCPcopy Create free account
hub / github.com/MrKepzie/Natron / addToPythonPathFunctor

Function addToPythonPathFunctor

Engine/AppManager.cpp:1857–1875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1855}
1856
1857static void
1858addToPythonPathFunctor(const QDir& directory)
1859{
1860 std::string addToPythonPath("sys.path.append(str('");
1861
1862 addToPythonPath += directory.absolutePath().toStdString();
1863 addToPythonPath += "').decode('utf-8'))\n";
1864
1865 std::string err;
1866 bool ok = NATRON_PYTHON_NAMESPACE::interpretPythonScript(addToPythonPath, &err, 0);
1867 if (!ok) {
1868 std::string message = QCoreApplication::translate("AppManager", "Could not add %1 to python path:").arg( directory.absolutePath() ).toStdString() + ' ' + err;
1869 std::cerr << message << std::endl;
1870 AppInstPtr topLevel = appPTR->getTopLevelInstance();
1871 if (topLevel) {
1872 topLevel->appendToScriptEditor( message.c_str() );
1873 }
1874 }
1875}
1876
1877void
1878AppManager::findAllScriptsRecursive(const QDir& directory,

Callers

nothing calls this directly

Calls 5

toStdStringMethod · 0.80
absolutePathMethod · 0.80
getTopLevelInstanceMethod · 0.80
translateFunction · 0.50
appendToScriptEditorMethod · 0.45

Tested by

no test coverage detected