| 1855 | } |
| 1856 | |
| 1857 | static void |
| 1858 | addToPythonPathFunctor(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 | |
| 1877 | void |
| 1878 | AppManager::findAllScriptsRecursive(const QDir& directory, |
nothing calls this directly
no test coverage detected