xbmc.getSetting(id) does'nt work for me?
#1
I'm writing a script that polls a server-ip and a port. Now I want to set ip-adress and port via configuration-dialog (<path-to-script>/resources/settings.xml):

Code:
<settings>
        <setting id="cti_server" type="text" label="30000" default="127.0.0.1" />
        <setting id="cti_port" type="text" label="30001" default="7777" />
</settings>

This works fine for me, but when I try to get settings my script fails with

Code:
10:47:02 T:3047152496 M:1438986240   ERROR: Error Type: <type 'exceptions.AttributeError'>
10:47:02 T:3047152496 M:1438986240   ERROR: Error Contents: 'module' object has no attribute 'getSetting'
10:47:02 T:3047152496 M:1438986240   ERROR: Traceback (most recent call last): File "...", line 2, in <module> c_ipaddr=xbmc.getSetting("cti_server")

The code:

Code:
import xbmc
c_ipaddr=xbmc.getSetting("cti_server")
c_port=xbmc.getSetting('cti_port')

What should be wrong?

_BJ1
Reply
#2
Code:
import xbmcaddon

__settings__   = xbmcaddon.Addon(id=[color=red]your.scriptId[/color])

c_ipaddr = __settings__.getSetting("cti_server")
c_port = __settings__.getSetting("cti_port")
Reply
#3
Yes... Thank you very much!

_BJ1
Reply
#4
I have similar issues, but what is your.scriptId in the line bellow?
Code:
__settings__   = xbmcaddon.Addon(id=your.scriptId)
Reply
#5
void0 Wrote:I have similar issues, but what is your.scriptId in the line bellow?
Code:
__settings__   = xbmcaddon.Addon(id=your.scriptId)

It is what is in the addon.xml as the addon id.

Code:
<addon id="script.cdartmanager"
       name="cdART Manager"
       version="1.5.3"
       provider-name="Giftie">

so the line for my script would be(and is):

Code:
__settings__ = xbmcaddon.Addon(id="script.cdartmanager")

this is also valid

Code:
__settings__ = xbmcaddon.Addon("script.cdartmanager")
Reply
#6
Thanks, now it works
Reply

Logout Mark Read Team Forum Stats Members Help
xbmc.getSetting(id) does'nt work for me?0