kodi
HTTPPythonWsgiInvoker.h
1 /*
2  * Copyright (C) 2015-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "interfaces/python/PythonInvoker.h"
12 #include "network/httprequesthandler/python/HTTPPythonInvoker.h"
13 #include "network/httprequesthandler/python/HTTPPythonRequest.h"
14 
15 #include <map>
16 #include <string>
17 
18 namespace XBMCAddon
19 {
20  namespace xbmcwsgi
21  {
22  class WsgiResponse;
23  }
24 }
25 
27 {
28 public:
30  ~CHTTPPythonWsgiInvoker() override;
31 
32  static void GlobalInitializeModules(void);
33 
34  // implementations of CHTTPPythonInvoker
35  HTTPPythonRequest* GetRequest() override;
36 
37 protected:
38  // overrides of CPythonInvoker
39  void executeScript(FILE* fp, const std::string& script, PyObject* moduleDict) override;
40  const char* getInitializationScript() const override;
41 
42 private:
43  static std::map<std::string, std::string> createCgiEnvironment(
44  const HTTPPythonRequest* httpRequest, const ADDON::AddonPtr& addon);
45  static void addWsgiEnvironment(HTTPPythonRequest* request, void* environment);
46 
47  XBMCAddon::xbmcwsgi::WsgiResponse* m_wsgiResponse;
48 };
Definition: WsgiResponse.h:33
Definition: HTTPPythonRequest.h:18
Definition: HTTPPythonWsgiInvoker.h:26
Definition: ILanguageInvocationHandler.h:13
Defining LOG_LIFECYCLE_EVENTS will log all instantiations, deletions and also reference countings (in...
Definition: Addon.cpp:25
Definition: HTTPPythonInvoker.h:16