Solved Bug in getSetting ?
#1
Problem:

getSetting(id) always returns: ""

Here is my testscript:

[addon.py]
import xbmc
import xbmcaddon
import xbmcgui

__addon__ = xbmcaddon.Addon(id='script.settings.test')

def log(info):
print '[############] %s'%repr(info)

log('Starting Test')

__addon__ = xbmcaddon.Addon()
__addon__.setSetting(id="var",value='hello')
answer = __addon__.getSetting(id="var")

log('Here should stand "hello": "%s"'%answer)

[addon.xml]
<?xml version="1.0" ?><addon id="script.settings.test" name="test" provider-name="merlink" version="0.0.0">
<requires>
<import addon="xbmc.python" version="2.14.0"/>
</requires>
<extension library="addon.py" point="xbmc.python.script"/>
<extension point="xbmc.addon.metadata">
</extension>
</addon>

My Result:
1. Run:

13:47:57 T:140437132072704 NOTICE: [############] 'Starting Test'
13:47:57 T:140437132072704 NOTICE: [############] 'Here should stand "hello": ""'

(Setting was written correctly!)
<settings>
<setting id="var" value="hello" />
</settings>

2 .Run:

13:49:41 T:139932240701184 NOTICE: [############] 'Starting Test'
13:49:41 T:139932240701184 NOTICE: [############] 'Here should stand "hello": ""'


Version:

14:41:40 T:140232943945664 NOTICE: Starting Kodi (14.0 Git:Unknown). Platform: Linux x86 64-bit
14:41:40 T:140232943945664 NOTICE: Using Release Kodi x64 build
14:41:40 T:140232943945664 NOTICE: Kodi compiled Jan 1 2015 by GCC 4.9.2 for Linux x86 64-bit version 3.18.1 (201217)
14:41:40 T:140232943945664 NOTICE: Running on Arch Linux 0.0, kernel: Linux x86 64-bit version 3.18.2-2-ARCH
Reply
#2
Recompiling from Github Source to recheck the Bug:
kodi-git 20150113.f185a3a-1 (So 1. Feb 15:00:55 CET 2015)
Reply
#3
OK: Same Error

14:51:45 T:140358466602752 NOTICE: [############] 'Starting Test'
14:51:45 T:140358466602752 NOTICE: [############] 'Here should stand "hello": ""'

Or do I something terribly wrong?
Reply
#4
have you included a settings.xml file in your addon?
it needs to be in the 'resources' folder.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
Hello Ronie,

thank you for your fast reply.

I tested with and without resources/settings.xml.
Reply
#6
Retested and now it's thereHuh

15:35:54 T:139779544286976 NOTICE: [############] 'Starting Test'
15:35:54 T:139779544286976 NOTICE: [############] 'Here should stand "hello": "hello"'

Stange, I could swear it wasnt there last time...

OK: Should be solved.

Thanks Ronie !!!!!
Reply
#7
So there should be an Error thrown in:

__addon__.setSetting(id="var",value='hello')
fe: Error: Variable not declared

It is not logical that saving the var runs without declaration and readout shows an empty string.

Also readout should throw an Exception instead of an empty string.
Reply

Logout Mark Read Team Forum Stats Members Help
Bug in getSetting ?0