| 1772 | } |
| 1773 | |
| 1774 | static void |
| 1775 | addToPythonPathFunctor(const QDir& directory) |
| 1776 | { |
| 1777 | std::string addToPythonPath("sys.path.append(str('"); |
| 1778 | |
| 1779 | addToPythonPath += directory.absolutePath().toStdString(); |
| 1780 | #if PY_MAJOR_VERSION >= 3 |
| 1781 | addToPythonPath += "'))\n"; |
| 1782 | #else |
| 1783 | addToPythonPath += "').decode('utf-8'))\n"; |
| 1784 | #endif |
| 1785 | |
| 1786 | std::string err; |
| 1787 | bool ok = NATRON_PYTHON_NAMESPACE::interpretPythonScript(addToPythonPath, &err, 0); |
| 1788 | if (!ok) { |
| 1789 | std::string message = QCoreApplication::translate("AppManager", "Could not add %1 to python path:").arg( directory.absolutePath() ).toStdString() + ' ' + err; |
| 1790 | std::cerr << message << std::endl; |
| 1791 | AppInstancePtr topLevel = appPTR->getTopLevelInstance(); |
| 1792 | if (topLevel) { |
| 1793 | topLevel->appendToScriptEditor( message.c_str() ); |
| 1794 | } |
| 1795 | } |
| 1796 | } |
| 1797 | |
| 1798 | void |
| 1799 | AppManager::findAllScriptsRecursive(const QDir& directory, |
nothing calls this directly
no test coverage detected