Changeset View
Changeset View
Standalone View
Standalone View
plugins/extensions/pykrita/kritarunner/main.cpp
Context not available. | |||||
26 | #include <KoGlobal.h> | 26 | #include <KoGlobal.h> | ||
---|---|---|---|---|---|
27 | #include <resources/KoHashGeneratorProvider.h> | 27 | #include <resources/KoHashGeneratorProvider.h> | ||
28 | #include "kis_md5_generator.h" | 28 | #include "kis_md5_generator.h" | ||
29 | #include "PythonPluginManager.h" | ||||
29 | #include <opengl/kis_opengl.h> | 30 | #include <opengl/kis_opengl.h> | ||
30 | 31 | | |||
31 | #include <engine.h> | | |||
32 | #include <utilities.h> | | |||
33 | | ||||
34 | extern "C" int main(int argc, char **argv) | 32 | extern "C" int main(int argc, char **argv) | ||
35 | { | 33 | { | ||
36 | // The global initialization of the random generator | 34 | // The global initialization of the random generator | ||
Context not available. | |||||
80 | qDebug() << "\tPython path:" << pythonPath; | 78 | qDebug() << "\tPython path:" << pythonPath; | ||
81 | 79 | | |||
82 | qDebug() << "Creating engine"; | 80 | qDebug() << "Creating engine"; | ||
83 | PyKrita::Engine engine; | | |||
84 | QString r = engine.tryInitializeGetFailureReason(); | | |||
85 | 81 | | |||
86 | if (!r.isEmpty()) { | 82 | // TODO: refactor to share common parts with plugin.cpp | ||
87 | qDebug("Could not initialize the Python engine"); | 83 | | ||
88 | return 1; | 84 | PyKrita::InitResult initResult = PyKrita::initialize(); | ||
85 | | ||||
86 | switch (initResult) { | ||||
87 | case PyKrita::INIT_OK: | ||||
88 | break; | ||||
89 | case PyKrita::INIT_CANNOT_LOAD_PYTHON_LIBRARY: | ||||
90 | qWarning() << i18n("Cannot load Python library"); | ||||
91 | return 1; | ||||
92 | case PyKrita::INIT_CANNOT_SET_PYTHON_PATHS: | ||||
93 | qWarning() << i18n("Cannot set Python paths"); | ||||
94 | return 1; | ||||
95 | case PyKrita::INIT_CANNOT_LOAD_PYKRITA_MODULE: | ||||
96 | qWarning() << i18n("Cannot load built-in pykrita module"); | ||||
97 | return 1; | ||||
98 | default: | ||||
99 | qWarning() << i18n("Unexpected error initializing python plugin."); | ||||
100 | return 1; | ||||
89 | } | 101 | } | ||
90 | 102 | | |||
91 | qDebug() << "Try to import the pykrita module"; | 103 | qDebug() << "Try to import the pykrita module"; | ||
Context not available. |