Package: sakee
SAKÉ: Simple ASCII Kodi EmulatorSAKÉ: your favourite 'drink' for debugging and developing Kodi Python add-onsSAKÉ can help you to debug and develop Kodi Python add-ons. It contains a set of libraries that try to mimic the functionality of the corresponding Kodi modules:ModulePurposexbmcGeneral functions on KodixbmcaddonKodi’s addon classxbmcguiGUI functions on Kodi.xbmcpluginPlugin functions on Kodi.xbmcvfsVirtual file system functions on Kodi.Not all libraries are present and certainly not all methods are implemented. Currently missing are:ModulePurposexbmcdrmKodi’s DRM class.Feel free to contribute to the completion using Pull Requests for this repository.UsingSAKÉSAKÉ can be installed using thepip installcommand:$ pip install sakeeThis will install SAKÉ in the active Python installation. It will be available directly to all your Python scripts. If you choose to not usepip installand want to run it from a specific (custom) location then you will need to include its path the Python paths. Either via:sys.path.append('<path to SAKÉ>')Or by appending theSAKÉpath to the Python path environment variable:PYTHONPATHConfigurationSAKÉrequires you to run with your add-on as the mainworking directory. Running it outside of that directory will fail.If your add-on is in a subfolder of Kodi'saddonsfolder, you are done.SAKÉwill try to find its own way and determine what your Kodi path is and where your profile is stored. However, if you are running it standalone, so without Kodi at all, or ifSAKÉgot 'drunk' and lost its way, you can always specify some directions using environment variables as follows:Environment VariableDescriptionKODI_HOMEIf specified, will forceSAKÉto look at that path for Kodi's home path.KODI_PROFILEIf specified, will forceSAKÉto use this folder as the Kodi 'master' profile (user_data) folder. This will disable the auto detection of the profile folder based on Kodi's home path.KODI_ACTIVE_PROFILESAKÉwill assume that you don't have any Kodi profiles, but in case you have, you can specify what profile to use for the add-on settings.KODI_INTERACTIVENormally,SAKÉwill try to interact with you: Whenever there should be a dialog shown within Kodi,SAKÉwill present you with an ASCII version and wait for a response. You can disable this by setting this environment variable to "0".SAKÉwill not disturb you and will continue. However,SAKÉwill answer those dialogs for you and thatmight result in unwanted actions, but it might come in handy while running unit tests.KODI_STUB_VERBOSEIf set to "1" will makeSAKÉa bit more verbose.KODI_STUB_RPC_RESPONSESSpecifies the folder from which to read JSON RPC responses. If you don't set this, you won't be able to usexbmc.executeJSONRPCKODI_STUB_INPUTSpecify the default input for the keyboard inputJSON RPC responsesIn order to respond to the JSON RPC requests, issued viaexecuteJSONRPC, a folder with response files can be configured using theKODI_STUB_RPC_RESPONSESenvironment variable (see above). This folder should contain response files with the following naming conversions:<method_name>.jsonSo, for instancefavourites.getfavourites.json. Inside the file there is:A single complete JSON response. In this case, the complete content of the file will be used, as is, as the JSON RPC response.A list of JSON request-response pairs with different input parameters. Using the input parameters of the JSON RPC request, the correct response is determined and returned as the JSON RPC response.In the latter case, the content of a stub file could look like this:[{"request":{"params":{"setting":"network.usehttpproxy"},"jsonrpc":"2.0","method":"Settings.GetSettingValue","id":0},"response":{"id":5,"jsonrpc":"2.0","result":{"value":false}}},{"request":{"params":{"setting":"network.httpproxyusername"},"jsonrpc":"2.0","method":"Settings.GetSettingValue","id":0},"response":{"id":5,"jsonrpc":"2.0","result":{"value":true}}}]This stub file contains responses for the methodSettings.GetSettingValuefor the settingnetwork.usehttpproxyandnetwork.httpproxyusername.If no file with matching method name is found or the file does not contain the correct responses an 'OK' is returned:{"id":1,"jsonrpc":"2.0","result":"OK"}Just like most of the Kodi JSON RPC calls do.