possibile fix errore in get_all_settings_addon

This commit is contained in:
mac12m99
2021-03-07 17:47:56 +01:00
parent bf2cd59db7
commit 61d7f86ea1

View File

@@ -170,13 +170,13 @@ def enable_disable_autorun(is_enabled):
set_setting('autostart', True)
return True
def get_all_settings_addon():
# Read the settings.xml file and return a dictionary with {id: value}
from core import scrapertools
infile = open(os.path.join(get_data_path(), "settings.xml"), "r")
data = infile.read()
infile.close()
with open(os.path.join(get_data_path(), "settings.xml"), "rb") as infile:
data = infile.read().decode('utf-8')
ret = {}
matches = scrapertools.find_multiple_matches(data, '<setting id=\"([^\"]+)\"[^>]*>([^<]*)</setting>')