-In the menu eventinfo(long info/epg)/extension(blue button) you are now able to re-order list via the < > buttons instantly
-button menu sort list to default and exit
Posted 13 March 2015 - 12:46
Maybe I am missing something, but why is it necessary for all staff on the screen init after "if self.reorderConfig:" if nothing has changed? http://sourceforge.n...hoiceBox.py#l33
Or better not be directly after the "if self.reorderConfig:" assign self.config_type, check whether its value is not ''", and only then do all other?
Posted 13 March 2015 - 14:32
I think something like this:
self.keymap = {} pos = 0 if self.reorderConfig: - prev_list = zip(list, self.__keys) - new_list = [] - self.config_type = eval("config.misc.pluginlist." + self.reorderConfig) - for x in self.config_type.value.split(","): - for entry in prev_list: - if entry[0][0] == x: - new_list.append(entry) - prev_list.remove(entry) - list = zip(*(new_list + prev_list)) - list, self.__keys = list[0], list[1] - number = 1 - new_keys = [] - for x in self.__keys: - if (not x or x.isdigit()) and number <= 10: - new_keys.append(str(number % 10)) - number+=1 - else: - new_keys.append(not x.isdigit() and x or "") + self.config_type = eval("config.misc.pluginlist." + self.reorderConfig) + if self.config_type.value != "": + prev_list = zip(list, self.__keys) + new_list = [] + for x in self.config_type.value.split(","): + for entry in prev_list: + if entry[0][0] == x: + new_list.append(entry) + prev_list.remove(entry) + list = zip(*(new_list + prev_list)) + list, self.__keys = list[0], list[1] + number = 1 + new_keys = [] + for x in self.__keys: + if (not x or x.isdigit()) and number <= 10: + new_keys.append(str(number % 10)) + number+=1 + else: + new_keys.append(not x.isdigit() and x or "") + self.__keys = new_keys for x in list: strpos = str(self.__keys[pos]) self.list.append(ChoiceEntryComponent(key = strpos, text = x))
If nothing has changed, then "config.misc.pluginlist. ..." must be empty, and do not need to do anything.
Edited by Taapat, 13 March 2015 - 14:35.
Posted 13 March 2015 - 17:17
I agree.
I know that it is faster and spend less resuces, but when I tried it before, for me it did not work after the eval. I do not know why, probably before I made a mistake somewhere, but now I see that it works.
Edited by Taapat, 13 March 2015 - 17:17.
0 members, 1 guests, 0 anonymous users