11 #include "interfaces/generic/ILanguageInvoker.h" 12 #include "interfaces/legacy/Addon.h" 13 #include "interfaces/python/LanguageHook.h" 14 #include "threads/CriticalSection.h" 15 #include "threads/Event.h" 21 typedef struct _object PyObject;
29 bool Execute(
const std::string& script,
30 const std::vector<std::string>& arguments = std::vector<std::string>())
override;
32 bool IsStopping()
const override {
return m_stop || ILanguageInvoker::IsStopping(); }
36 bool execute(
const std::string& script,
const std::vector<std::string>& arguments)
override;
37 virtual void executeScript(FILE* fp,
const std::string& script, PyObject* moduleDict);
38 bool stop(
bool abort)
override;
39 void onExecutionDone()
override;
40 void onExecutionFailed()
override;
43 virtual const char* getInitializationScript()
const = 0;
44 virtual void onInitialization();
46 virtual void onPythonModuleInitialization(
void* moduleDict);
47 virtual void onDeinitialization();
49 virtual void onSuccess() {}
50 virtual void onAbort() {}
51 virtual void onError(
const std::string& exceptionType =
"",
52 const std::string& exceptionValue =
"",
53 const std::string& exceptionTraceback =
"");
55 std::string m_sourceFile;
56 CCriticalSection m_critical;
59 void getAddonModuleDeps(
const ADDON::AddonPtr& addon, std::set<std::string>& paths);
60 bool execute(
const std::string& script, std::vector<std::wstring>& arguments);
61 FILE* PyFile_AsFileWithMode(PyObject* py_file,
const char* mode);
63 PyThreadState* m_threadState;
68 bool m_systemExitThrown =
false;
70 static CCriticalSection s_critical;
73 struct PyObjectDeleter
75 void operator()(PyObject* p)
const;
79 typedef std::unique_ptr<PyObject, PyObjectDeleter> PyObjectPtr;
This is an Event class built from a ConditionVariable.
Definition: Event.h:35
Definition: PythonInvoker.h:23
Definition: ILanguageInvocationHandler.h:13
Definition: ILanguageInvoker.h:31