Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
AddonPythonInvoker.cpp File Reference
#include "AddonPythonInvoker.h"
#include <utility>
#include <Python.h>
#include <osdefs.h>

Namespaces

namespace  PythonBindings
 

Macros

#define MODULE   "xbmc"
 
#define RUNSCRIPT_PREAMBLE
 
#define RUNSCRIPT_SETUPTOOLS_HACK
 
#define RUNSCRIPT_SETUP_ENVIROMENT_VARIABLES
 
#define RUNSCRIPT_POSTSCRIPT
 
#define RUNSCRIPT_COMPLIANT    RUNSCRIPT_PREAMBLE RUNSCRIPT_POSTSCRIPT
 

Functions

PyObjectPythonBindings::PyInit_Module_xbmcdrm (void)
 
PyObjectPythonBindings::PyInit_Module_xbmcgui (void)
 
PyObjectPythonBindings::PyInit_Module_xbmc (void)
 
PyObjectPythonBindings::PyInit_Module_xbmcplugin (void)
 
PyObjectPythonBindings::PyInit_Module_xbmcaddon (void)
 
PyObjectPythonBindings::PyInit_Module_xbmcvfs (void)
 

Macro Definition Documentation

◆ MODULE

#define MODULE   "xbmc"

◆ RUNSCRIPT_COMPLIANT

#define RUNSCRIPT_COMPLIANT    RUNSCRIPT_PREAMBLE RUNSCRIPT_POSTSCRIPT

◆ RUNSCRIPT_POSTSCRIPT

#define RUNSCRIPT_POSTSCRIPT
Value:
"print('-->Python Interpreter Initialized<--')\n" \
""

◆ RUNSCRIPT_PREAMBLE

#define RUNSCRIPT_PREAMBLE
Value:
"" \
"import " MODULE "\n" \
"class xbmcout:\n" \
" def __init__(self, loglevel=" MODULE ".LOGDEBUG):\n" \
" self.ll=loglevel\n" \
" def write(self, data):\n" \
" " MODULE ".log(data,self.ll)\n" \
" def close(self):\n" \
" " MODULE ".log('.')\n" \
" def flush(self):\n" \
" " MODULE ".log('.')\n" \
"import sys\n" \
"sys.stdout = xbmcout()\n" \
"sys.stderr = xbmcout(" MODULE ".LOGERROR)\n" \
""
#define MODULE
Definition AddonPythonInvoker.cpp:17

◆ RUNSCRIPT_SETUP_ENVIROMENT_VARIABLES

#define RUNSCRIPT_SETUP_ENVIROMENT_VARIABLES
Value:
"" \
"from os import environ\n" \
"environ['SSL_CERT_FILE'] = 'system/certs/cacert.pem'\n" \
""

◆ RUNSCRIPT_SETUPTOOLS_HACK

#define RUNSCRIPT_SETUPTOOLS_HACK
Value:
"" \
"import types,sys\n" \
"pkg_resources_code = \\\n" \
"\"\"\"\n" \
"def resource_filename(__name__,__path__):\n" \
" return __path__\n" \
"\"\"\"\n" \
"pkg_resources = types.ModuleType('pkg_resources')\n" \
"exec(pkg_resources_code, pkg_resources.__dict__)\n" \
"sys.modules['pkg_resources'] = pkg_resources\n" \
""