Accessing System settings from python script
#1
Hi,

is it possible to change/query system settings from python scripts? For example, I want to change Appearance - Settings - International - Language setting - of course, when I change it I want immediate effect without need to restart XBMC. I know that by using xbmc.getInfoLabel("...") you can get some of the available settings, but I didn't found any API to change them.

Thanks.
Reply
#2
you can change what you want in userdata file then reload the skin via python.
Reply
#3
Thanks. I just tried and if I manually change locale setting inside userdata/guisettings.xml from the python script running inside XBMC and then call xbmc.executebuiltin("ReloadSkin()") two things happens which I don't like:
1) XBMC removes my script window from the screen and returns back to the scripts list window. Can I return back, after skin reloads, to the my script window somehow?
2) My change is completely discarded and replaced with old setting (maybe ReloadSkin saves settings from the memory back into the the file before reload happens).
Reply
#4
I managed to change setting with the following call:

xbmc.executehttpapi("SetGUISetting(3;locale.language;%s)" % language)

Also, this is the general way to change any setting.

But, I still have a problem with xbmc.executebuiltin("ReloadSkin()") because it doesn't switch to the new language, so I need to restart the XBMC. BTW Is there a nice way to restart XBMC from python script?
Reply

Logout Mark Read Team Forum Stats Members Help
Accessing System settings from python script0