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

Classes

struct  PythonModule
 

Namespaces

namespace  PythonBindings
 

Macros

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

Functions

void PythonBindings::initModule_xbmcdrm (void)
 
void PythonBindings::initModule_xbmcgui (void)
 
void PythonBindings::initModule_xbmc (void)
 
void PythonBindings::initModule_xbmcplugin (void)
 
void PythonBindings::initModule_xbmcaddon (void)
 
void PythonBindings::initModule_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" \
"xbmc.abortRequested = False\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_SETUPTOOLS_HACK

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