|
Krita Source Code Documentation
|
#include <PythonPluginManager.h>
Inheritance diagram for PythonPluginManager:Public Slots | |
| void | unloadAllModules () |
Public Member Functions | |
| PythonPluginsModel * | model () |
| PythonPlugin * | plugin (int index) |
| const QList< PythonPlugin > & | plugins () const |
| PythonPluginManager () | |
| void | scanPlugins () |
| void | setPluginEnabled (PythonPlugin &plugin, bool enabled) |
| void | tryLoadEnabledPlugins () |
Private Member Functions | |
| void | loadModule (PythonPlugin &plugin) |
| void | unloadModule (PythonPlugin &plugin) |
Static Private Member Functions | |
| static QPair< QString, PyKrita::version_checker > | parseDependency (const QString &) |
| static void | verifyDependenciesSetStatus (PythonPlugin &) |
| static bool | verifyModuleExists (PythonPlugin &) |
Private Attributes | |
| PythonPluginsModel | m_model |
| QList< PythonPlugin > | m_plugins |
The Python plugin manager handles discovery, loading and unloading of Python plugins. To get a reference to the manager, use PyKrita::pluginManager().
Definition at line 102 of file PythonPluginManager.h.
| PythonPluginManager::PythonPluginManager | ( | ) |
Definition at line 67 of file PythonPluginManager.cpp.
|
private |
Definition at line 324 of file PythonPluginManager.cpp.
References dbgScript, PyKrita::Python::functionCall(), PythonPlugin::isBroken(), PythonPlugin::isEnabled(), PyKrita::Python::itemString(), KIS_SAFE_ASSERT_RECOVER_NOOP, KIS_SAFE_ASSERT_RECOVER_RETURN, PyKrita::Python::lastTraceback(), PythonPlugin::m_broken, PythonPlugin::m_errorReason, PythonPlugin::m_loaded, PythonPlugin::moduleName(), plugin(), plugins(), PQ, PyKrita::Python::PYKRITA_ENGINE, warnScript, and KisUsageLogger::writeSysInfo().
| PythonPluginsModel * PythonPluginManager::model | ( | ) |
Definition at line 85 of file PythonPluginManager.cpp.
References m_model.
|
staticprivate |
Definition at line 134 of file PythonPluginManager.cpp.
References dbgScript, PyKrita::version_checker::fromString(), PyKrita::version_checker::isValid(), and PyKrita::version_checker::undefined.
| PythonPlugin * PythonPluginManager::plugin | ( | int | index | ) |
Definition at line 77 of file PythonPluginManager.cpp.
References m_plugins.
| const QList< PythonPlugin > & PythonPluginManager::plugins | ( | ) | const |
Definition at line 72 of file PythonPluginManager.cpp.
References m_plugins.
| void PythonPluginManager::scanPlugins | ( | ) |
Definition at line 259 of file PythonPluginManager.cpp.
References currentLocale(), dbgScript, PythonPlugin::errorReason(), KoResourcePaths::findAllAssets(), PythonPlugin::isBroken(), PythonPlugin::isValid(), PythonPlugin::m_comment, PythonPlugin::m_enabled, PythonPlugin::m_manual, PythonPlugin::m_moduleName, PythonPlugin::m_name, m_plugins, PythonPlugin::moduleName(), PythonPlugin::name(), plugin(), verifyDependenciesSetStatus(), and verifyModuleExists().
| void PythonPluginManager::setPluginEnabled | ( | PythonPlugin & | plugin, |
| bool | enabled ) |
Definition at line 398 of file PythonPluginManager.cpp.
References PythonPlugin::isEnabled(), loadModule(), PythonPlugin::m_enabled, PythonPlugin::moduleName(), plugin(), and unloadModule().
| void PythonPluginManager::tryLoadEnabledPlugins | ( | ) |
Definition at line 309 of file PythonPluginManager.cpp.
References dbgScript, PythonPlugin::isBroken(), PythonPlugin::isEnabled(), loadModule(), PythonPlugin::m_enabled, m_plugins, PythonPlugin::moduleName(), plugin(), and KisUsageLogger::writeSysInfo().
|
slot |
Definition at line 90 of file PythonPluginManager.cpp.
References PythonPlugin::m_loaded, m_plugins, plugin(), and unloadModule().
|
private |
Definition at line 369 of file PythonPluginManager.cpp.
References dbgScript, PyKrita::Python::functionCall(), PythonPlugin::isBroken(), PyKrita::Python::itemString(), KIS_SAFE_ASSERT_RECOVER_RETURN, PythonPlugin::m_loaded, PythonPlugin::moduleName(), plugin(), plugins(), PQ, and PyKrita::Python::PYKRITA_ENGINE.
|
staticprivate |
Collect dependencies and check them. To do it just try to import a module... when unload it ;)
X-Python-Dependencies property of .desktop file has the following format: python-module(version-info), where python-module a python module name to be imported, version-spec is a version triplet delimited by dots, possible w/ leading compare operator: =, <, >, <=, >=
Definition at line 169 of file PythonPluginManager.cpp.
References dbgScript, PyKrita::version::fromPythonObject(), PythonPlugin::isBroken(), PyKrita::version_checker::isEmpty(), PythonPlugin::isUnstable(), PyKrita::version::isValid(), PyKrita::version_checker::isValid(), PyKrita::Python::itemString(), PyKrita::Python::lastTraceback(), PythonPlugin::m_broken, PythonPlugin::m_errorReason, PythonPlugin::m_unstable, PythonPlugin::name(), PyKrita::version_checker::operationToString(), parseDependency(), plugin(), PQ, PythonPlugin::property(), and PyKrita::version_checker::required().
|
staticprivate |
Definition at line 99 of file PythonPluginManager.cpp.
References dbgScript, KoResourcePaths::findAsset(), PythonPlugin::m_broken, PythonPlugin::m_errorReason, PythonPlugin::moduleFilePathPart(), PythonPlugin::moduleName(), and plugin().
|
private |
Definition at line 131 of file PythonPluginManager.h.
|
private |
Definition at line 129 of file PythonPluginManager.h.