I'm working on my python script as I would like to check on the value in the settings.xml that if they have the value is true or false. I want to check the value in xml file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<settings>
<category label="30101">
<setting id="myidname.enabled" value="false"/>
</category>
</settings>
I have tried this:
import xbmc
import xbmcgui
import xbmcplugin
ACTION_BACKSPACE = 110
def onAction(self, action):
if action == ACTION_BACKSPACE:
if self.Settings == xbmc.getSetting("myidname.enabled") == True:
self.settings.setSetting("id=myidname.enabled", "value=false")
It will not let me to check the value in settings.xml that if I have the value is true. How do you write the code for python using if statement that I want to check in the settings with the id if it have the value is set to true?
Secondly, I'm using this code to allow me to overwritten the value in the settings.xml:
self.settings.setSetting(id="myidname.enabled", value="true")
It will not let me to overwritten the value. How do you write the code for python to allow me to overwritten the value in settings.xml in the same line as the id?
The file location for settings.xml is in: c:\users\user\appdata\roaming\xbmc\addons\script.tvguide\resources.
Here's the update xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<settings>
<category label="30101">
<setting id="myid.enabled" value="false"/>
<setting id="myid1.enabled" value="false"/>
<setting id="myid2.enabled" value="false"/>
<setting id="myid3.enabled" value="false"/>
<setting id="myid4.enabled" value="false"/>
<setting id="myid5.enabled" value="false"/>
<setting id="myid6.enabled" value="false"/>
<setting id="myid7.enabled" value="false"/>
</category>
</settings>