MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / findAllScriptsRecursive

Method findAllScriptsRecursive

Engine/AppManager.cpp:1798–1834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1796}
1797
1798void
1799AppManager::findAllScriptsRecursive(const QDir& directory,
1800 QStringList& allPlugins,
1801 QStringList *foundInit,
1802 QStringList *foundInitGui)
1803{
1804 if ( !directory.exists() ) {
1805 return;
1806 }
1807
1808 QStringList filters;
1809 filters << QString::fromUtf8("*.py");
1810 QStringList files = directory.entryList(filters, QDir::Files | QDir::NoDotAndDotDot);
1811 bool ok = findAndRunScriptFile( directory.absolutePath() + QChar::fromLatin1('/'), files, QString::fromUtf8("init.py") );
1812 if (ok) {
1813 foundInit->append( directory.absolutePath() + QString::fromUtf8("/init.py") );
1814 }
1815 if ( !appPTR->isBackground() ) {
1816 ok = findAndRunScriptFile( directory.absolutePath() + QChar::fromLatin1('/'), files, QString::fromUtf8("initGui.py") );
1817 if (ok) {
1818 foundInitGui->append( directory.absolutePath() + QString::fromUtf8("/initGui.py") );
1819 }
1820 }
1821
1822 for (QStringList::iterator it = files.begin(); it != files.end(); ++it) {
1823 if ( it->endsWith( QString::fromUtf8(".py") ) && ( *it != QString::fromUtf8("init.py") ) && ( *it != QString::fromUtf8("initGui.py") ) ) {
1824 allPlugins.push_back(directory.absolutePath() + QChar::fromLatin1('/') + *it);
1825 }
1826 }
1827
1828 QStringList subDirs = directory.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
1829 Q_FOREACH(const QString &subDir, subDirs) {
1830 QDir d(directory.absolutePath() + QChar::fromLatin1('/') + subDir);
1831
1832 findAllScriptsRecursive(d, allPlugins, foundInit, foundInitGui);
1833 }
1834}
1835
1836void
1837AppManager::loadPythonGroups()

Callers

nothing calls this directly

Calls 6

absolutePathMethod · 0.80
appendMethod · 0.80
isBackgroundMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected