diff --git a/src/gen/plug/menu/_enumeratedlist.py b/src/gen/plug/menu/_enumeratedlist.py index 96ae08173..9c9da2093 100644 --- a/src/gen/plug/menu/_enumeratedlist.py +++ b/src/gen/plug/menu/_enumeratedlist.py @@ -110,12 +110,7 @@ class EnumeratedListOption(Option): @type value: The type will depend on the type of option. @return: nothing """ - found = False - for (opt_value, opt_description) in self.__items: - if value == opt_value: - found = True - - if found: + if any(value == v for v, d in self.__items): Option.set_value(self, value) else: print "Value %s not found for option %s" % ( str(value), diff --git a/src/gen/plug/menu/_filter.py b/src/gen/plug/menu/_filter.py index d6b906512..677971fa4 100644 --- a/src/gen/plug/menu/_filter.py +++ b/src/gen/plug/menu/_filter.py @@ -62,14 +62,10 @@ class FilterOption(EnumeratedListOption): @type filter_list: array @return: nothing """ - items = [] curval = self.get_value() + items = [(value, filt.get_name()) + for value, filt in enumerate(filter_list)] - value = 0 - for filt in filter_list: - items.append((value, filt.get_name())) - value += 1 - self.__filters = filter_list self.clear() self.set_items( items )