• 1
  • 4
  • 5
  • 6
  • 7
  • 8(current)
HOW-TO write GUI settings for XBMC python plugins and scripts (addons)
Hi,
    I created a addon for kodi by using PI, to enable configuration in addon. I created a setting.xml file inside the resource folder, I'm trying to provide the folder location as the input to the addon as follows.

Setting.xml:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
       <setting id="Path" type="folder" label="30000" default="/home" />
    <setting type="sep" /> 
</settings>


Here i want to get the given folder path on my default.py so i simply used it

default.py:

GUI_Path = xbmcplugin.getSetting("Path")
xbmcgui.Dialog().ok(addonname,GUI_Path)

I just tried to view the folder path in Dialog box, but i'm ending up with the error like.

kodi.log:

19:52:10.982 T:1890579200  NOTICE: Running database version Addons27
19:52:10.989 T:1890579200  NOTICE: Running database version ViewModes6
19:52:10.998 T:1890579200  NOTICE: Running database version Textures13
19:52:11.015 T:1890579200  NOTICE: Running database version MyMusic60
19:52:11.042 T:1890579200  NOTICE: Running database version MyVideos107
19:52:11.049 T:1890579200  NOTICE: Running database version TV29
19:52:11.055 T:1890579200  NOTICE: Running database version Epg11
19:52:11.064 T:1910763520  NOTICE: start dvd mediatype detection
19:52:11.121 T:1773859584  NOTICE: Register - new cec device registered on cec->RPI: CEC Adapter (2708:1001)
19:52:12.067 T:1910763520 WARNING: JSONRPC: Could not parse type "Setting.Details.SettingList"
19:52:12.737 T:1910763520  NOTICE: initialize done
19:52:12.738 T:1910763520  NOTICE: Running the application...
19:52:12.799 T:1910763520  NOTICE: starting zeroconf publishing
19:52:12.799 T:1910763520  NOTICE: CWebServer[8080]: Started
19:52:12.800 T:1910763520  NOTICE: starting upnp client
19:52:12.800 T:1910763520  NOTICE: starting upnp server
19:52:12.811 T:1910763520  NOTICE: starting upnp controller
19:52:12.811 T:1910763520  NOTICE: starting upnp renderer
19:52:12.829 T:1574712064  NOTICE: ES: Starting UDP Event server on port 9777
19:52:12.831 T:1574712064  NOTICE: UDP: Listening on port 9777 (ipv6 : true)
19:52:12.836 T:1910763520   ERROR: JSONRPC Server: Failed to connect to sdpd
19:52:17.790 T:1890579200   ERROR: CUPnPDirectory::GetResource - unable to find uuid folder.jpg
19:52:19.675 T:1890579200   ERROR: GetDirectory - Error getting
19:53:11.103 T:762495744   ERROR: Previous line repeats 6 times.
19:53:11.103 T:762495744   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.TypeError'>
                                            Error Contents: an integer is required
                                            Traceback (most recent call last):
                                              File "/home/pi/.kodi/addons/plugin.audio.example/default.py", line 117, in <module>
                                                GUI_Path = xbmcplugin.getSetting("Path")
                                            TypeError: an integer is required
                                            -->End of Python script error report<--
19:53:11.148 T:1910763520   ERROR: GetDirectory - Error getting plugin://plugin.audio.example/
19:53:11.149 T:1910763520   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.audio.example/) failed
19:53:21.529 T:1910763520  NOTICE: Storing total System Uptime
19:53:21.530 T:1910763520  NOTICE: Saving settings
19:53:21.543 T:1910763520  NOTICE: Saving skin settings
19:53:21.547 T:1910763520  NOTICE: stop all



I just want to collect the folder location as a string to use inside my python code, 

Thank you in advance.
Reply
(2018-01-19, 07:06)prvinrc Wrote: GUI_Path = xbmcplugin.getSetting("Path")

Kodi documentation says you need to do this:

python:
GUI_Path = xbmcplugin.getSetting(int(sys.argv[1]), "Path")
Reply
Hi!

I'm trying to move Netflix add-on settings to the new format 
xml:
<settings version="1">

But for now, I'm stucked on this:

xml:
<setting id="logout" type="action" label="30017" action="RunPlugin(plugin://plugin.video.netflix/action/logout/)" option="close"/>

Can you help me to encode this in the new format? Everything I tried failed...

Thanks!
Reply
  • 1
  • 4
  • 5
  • 6
  • 7
  • 8(current)

Logout Mark Read Team Forum Stats Members Help
HOW-TO write GUI settings for XBMC python plugins and scripts (addons)1