Esempio n. 1
0
def toggle_reuselanguageinvoker():
    file_path = os.path.join(g.ADDON_DATA_PATH, "addon.xml")

    with open(file_path, "r") as addon_xml:
        file_lines = addon_xml.readlines()

    for i in range(len(file_lines)):
        if "reuselanguageinvoker" in file_lines[i]:
            if "false" in file_lines[i]:
                file_lines[i] = file_lines[i].replace("false", "true")
                g.set_setting("reuselanguageinvoker.status", "Enabled")
            else:
                file_lines[i] = file_lines[i].replace("true", "false")
                g.set_setting("reuselanguageinvoker.status", "Disabled")
            break

    with open(file_path, "w+") as addon_xml:
        addon_xml.writelines(file_lines)
    xbmcgui.Dialog().ok(g.ADDON_NAME, g.get_language_string(30572))
    g.reload_profile()
 def _store_and_reload(output):
     with open(file_path, "w+") as addon_xml:
         addon_xml.writelines(output)
     xbmcgui.Dialog().ok(g.ADDON_NAME, g.get_language_string(30560))
     g.reload_profile()