create a .restored version of guisettings

This commit is contained in:
Rob Weber 2014-11-10 12:33:55 -06:00
parent 72b2abfe8d
commit c578fe15d8

View File

@ -6,6 +6,7 @@ import xbmc,xbmcvfs
class GuiSettingsManager:
settingsFile = None
doc = None
settings_allowed = list()
found_settings = list()
@ -44,6 +45,9 @@ class GuiSettingsManager:
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "id":1, "method":"Settings.SetSettingValue","params":{"setting":"' + aSetting.json_name() + '","value":' + aSetting.value + '}}')
else:
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "id":1, "method":"Settings.SetSettingValue","params":{"setting":"' + aSetting.json_name() + '","value":"' + aSetting.value + '"}}')
#make a copy of the guisettings file to make user based restores easier
xbmcvfs.copy(self.settingsFile, xbmc.translatePath("special://home/userdata/guisettings.xml.restored"))
def __parseNodes(self,nodeList):
result = []
@ -73,10 +77,9 @@ class GuiSettingsManager:
def _readFile(self,fileLoc):
if(xbmcvfs.exists(fileLoc)):
try:
self.doc = minidom.parse(fileLoc)
self.settingsFile = fileLoc
except ExpatError:
utils.log("Can't read " + fileLoc)