def Remove_Content(id_array=[]): remove_list = [] # If Super Favourites exist add option to remove a social share sf_path = xbmc.translatePath( 'special://profile/addon_data/plugin.program.super.favourites/Super Favourites/%s' % settings_clean) if len(os.listdir(sf_path)) > 0: remove_list.append(String(30354)) my_text = Text_File(redirect_file, 'r') for item in id_array: if item[0] == 'apk': remove_list.append(String(30304) % item[1]) elif item[0] == 'addon': remove_list.append(String(30305) % item[1]) elif item[0] == '-exec' or item[0] == '-fav': remove_list.append(item[1]) choice = dialog.select(String(30307), remove_list) if choice >= 0: if remove_list[choice] != String(30354): remove_line = '%s~%s~%s\n' % ( id_array[choice][0], id_array[choice][1], id_array[choice][2]) if remove_line in my_text: replace_file = my_text.replace(remove_line, '') Text_File(redirect_file, 'w', replace_file) else: dialog.ok( 'DEFAULT ITEM', 'It\'s only possible to delete items you\'ve added, you cannot delete default items. If you want to create your own custom list set this menu as a custom list via the main +- button' ) # Social share removal else: default.Share_Removal(settings_clean)
def Remove_Content(id_array=[]): remove_list = [] my_text = Text_File(redirect_file, 'r') for item in id_array: if item[0] == 'apk': remove_list.append(String(30304) % item[1]) elif item[0] == 'addon': remove_list.append(String(30305) % item[1]) elif item[0] == '-exec' or item[0] == '-fav': remove_list.append(item[1]) choice = dialog.select(String(30307), remove_list) if choice >= 0: remove_line = '%s~%s~%s\n' % (id_array[choice][0], id_array[choice][1], id_array[choice][2]) if remove_line in my_text: replace_file = my_text.replace(remove_line, '') Text_File(redirect_file, 'w', replace_file) else: dialog.ok( 'DEFAULT ITEM', 'It\'s only possible to delete items you\'ve added, you cannot delete default items. If you want to create your own custom list set this menu as a custom list via the main +- button' )