diff options
author | mathieui <mathieui@mathieui.net> | 2016-08-28 16:51:24 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2016-08-28 16:51:24 +0200 |
commit | 2252f2779c3568923d677491ee7df394abeadb6d (patch) | |
tree | ee6ff7b1eecb07e6c262f4de5a6475719b35ac0f /poezio/windows | |
parent | 50d6edc30b13dc70c4970773dbae4305263b641f (diff) | |
download | poezio-2252f2779c3568923d677491ee7df394abeadb6d.tar.gz poezio-2252f2779c3568923d677491ee7df394abeadb6d.tar.bz2 poezio-2252f2779c3568923d677491ee7df394abeadb6d.tar.xz poezio-2252f2779c3568923d677491ee7df394abeadb6d.zip |
Fix some type inconsistencies
(pylint)
Diffstat (limited to 'poezio/windows')
-rw-r--r-- | poezio/windows/data_forms.py | 8 | ||||
-rw-r--r-- | poezio/windows/inputs.py | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/poezio/windows/data_forms.py b/poezio/windows/data_forms.py index 54b28540..4d9eda93 100644 --- a/poezio/windows/data_forms.py +++ b/poezio/windows/data_forms.py @@ -14,7 +14,7 @@ from poezio.theming import to_curses_attr, get_theme class FieldInput(object): """ - All input type in a data form should inherite this class, + All input types in a data form should inherit this class, in addition with windows.Input or any relevant class from the 'windows' library. """ @@ -124,8 +124,10 @@ class TextMultiWin(FieldInput, Win): def __init__(self, field): FieldInput.__init__(self, field) Win.__init__(self) - self.options = field.get_value() - if not isinstance(self.options, list): + options = field.get_value() + if isinstance(self.options, list): + self.options = options + else: self.options = self.options.split('\n') if self.options else [] self.val_pos = 0 self.edition_input = None diff --git a/poezio/windows/inputs.py b/poezio/windows/inputs.py index d1716914..7e0155e1 100644 --- a/poezio/windows/inputs.py +++ b/poezio/windows/inputs.py @@ -563,6 +563,7 @@ class HistoryInput(Input): def __init__(self): Input.__init__(self) self.help_message = '' + self.histo_pos = -1 self.current_completed = '' self.key_func['^R'] = self.toggle_search self.search = False @@ -647,7 +648,6 @@ class MessageInput(HistoryInput): def __init__(self): HistoryInput.__init__(self) self.last_completion = None - self.histo_pos = -1 self.key_func["KEY_UP"] = self.key_up self.key_func["M-A"] = self.key_up self.key_func["KEY_DOWN"] = self.key_down @@ -702,7 +702,6 @@ class CommandInput(HistoryInput): self.key_func["M-A"] = self.key_up self.key_func["KEY_DOWN"] = self.key_down self.key_func["M-B"] = self.key_down - self.histo_pos = -1 def do_command(self, key, reset=True, raw=False): res = Input.do_command(self, key, reset=reset, raw=raw) |