#ifndef PYTHONRUNNER_H #define PYTHONRUNNER_H #include #include #include #include #include #include #ifdef RUNNER_BUILD #define RUNNER_DLL_EXPORT Q_DECL_EXPORT #else #define RUNNER_DLL_EXPORT Q_DECL_IMPORT #endif namespace mo2::python { // python runner interface // class IPythonRunner { public: virtual QList load(const QString& identifier) = 0; virtual void unload(const QString& identifier) = 0; // initialize Python // // pythonPaths contains the list of built-in paths for the Python library // (pythonxxx.zip, etc.), an empty list uses the default Python paths (e.g., the // PYTHONPATH environment variable) // virtual bool initialize(std::vector const& pythonPaths = {}) = 0; // add a native extension/library search path // virtual void addDllSearchPath(std::filesystem::path const& dllPath) = 0; // check if the runner has been initialized, i.e., initialize() has been // called and succeeded virtual bool isInitialized() const = 0; virtual ~IPythonRunner() {} }; // create the Python runner // RUNNER_DLL_EXPORT std::unique_ptr createPythonRunner(); } // namespace mo2::python #endif // PYTHONRUNNER_H