commit 3a03cf0cbefcf004982e0de270a28b1a4ac3f659 Author: Damian Johnson atagar@torproject.org Date: Sat Sep 26 00:29:33 2015 -0700
Drop ConfigEntry's get_all() method
Just an alias for list comprehension, and only used for sorting. --- nyx/config_panel.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/nyx/config_panel.py b/nyx/config_panel.py index ed1d1e1..6d80234 100644 --- a/nyx/config_panel.py +++ b/nyx/config_panel.py @@ -93,16 +93,6 @@ class ConfigEntry():
return self._get_value() if field == Field.VALUE else self.fields[field]
- def get_all(self, fields): - """ - Provides back a list with the given field values. - - Arguments: - field - enums for the fields to be provided back - """ - - return [self.get(field) for field in fields] - def get_label(self, option_width, value_width, summary_width): """ Provides display string of the configuration entry with the given @@ -269,8 +259,8 @@ class ConfigPanel(panel.Panel): if ordering: CONFIG['features.config.order'] = ordering
- self.conf_contents.sort(key=lambda i: (i.get_all(CONFIG['features.config.order']))) - self.conf_important_contents.sort(key=lambda i: (i.get_all(CONFIG['features.config.order']))) + self.conf_contents.sort(key=lambda i: ([i.get(field) for field in CONFIG['features.config.order']])) + self.conf_important_contents.sort(key=lambda i: ([i.get(field) for field in CONFIG['features.config.order']]))
def show_sort_dialog(self): """