From 3858273084b78f178d18f1c1fa1a9835e4a2b866 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sun, 4 May 2014 20:45:48 +0200 Subject: Fix two tb in the DataFormTab - when list-multi doesn't have selected values at all - text-multi.options() provided by sleekxmpp is apparently a '\n' separated string, and not a list --- src/tabs/data_forms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/tabs/data_forms.py') diff --git a/src/tabs/data_forms.py b/src/tabs/data_forms.py index 44c29e6c..70190243 100644 --- a/src/tabs/data_forms.py +++ b/src/tabs/data_forms.py @@ -197,6 +197,7 @@ class TextMultiWin(FieldInput, windows.Win): FieldInput.__init__(self, field) windows.Win.__init__(self) self.options = field.getValue() + self.options = self.options.split('\n') if self.options else [] self.val_pos = 0 self.edition_input = None if not isinstance(self.options, list): @@ -270,9 +271,9 @@ class ListMultiWin(FieldInput, windows.Win): def __init__(self, field): FieldInput.__init__(self, field) windows.Win.__init__(self) - values = field.getValue() + values = field.getValue() or [] self.options = [[option, True if option['value'] in values else False]\ - for option in field.getOptions()] + for option in field.get_options()] self.val_pos = 0 def do_command(self, key): -- cgit v1.2.3