summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2022-01-29 23:36:21 +0100
committermathieui <mathieui@mathieui.net>2022-01-29 23:42:24 +0100
commit9cc861eeff9116d297712737ae42475203820ac6 (patch)
treed2e8ffb7dadb2c8b2defd1cb9f12ee7f74516814
parent13c731dfe376baf6a0ada79013f12cf8ac037047 (diff)
downloadpoezio-9cc861eeff9116d297712737ae42475203820ac6.tar.gz
poezio-9cc861eeff9116d297712737ae42475203820ac6.tar.bz2
poezio-9cc861eeff9116d297712737ae42475203820ac6.tar.xz
poezio-9cc861eeff9116d297712737ae42475203820ac6.zip
ci: fix mypy analysis
-rw-r--r--poezio/logger.py2
-rw-r--r--poezio/windows/inputs.py14
2 files changed, 9 insertions, 7 deletions
diff --git a/poezio/logger.py b/poezio/logger.py
index 4b7856da..21667924 100644
--- a/poezio/logger.py
+++ b/poezio/logger.py
@@ -255,7 +255,7 @@ class Logger:
if jidstr in self._fds.keys():
fd = self._fds[jidstr]
else:
- option_fd = self._check_and_create_log_dir(jid)
+ option_fd = self._check_and_create_log_dir(jidstr)
if option_fd is None:
return True
fd = option_fd
diff --git a/poezio/windows/inputs.py b/poezio/windows/inputs.py
index 7ee8aa45..89da054e 100644
--- a/poezio/windows/inputs.py
+++ b/poezio/windows/inputs.py
@@ -5,7 +5,7 @@ Text inputs.
import curses
import logging
import string
-from typing import List, Dict, Callable, Optional
+from typing import List, Dict, Callable, Optional, ClassVar, Union
from poezio import keyboard
from poezio import common
@@ -592,9 +592,10 @@ class HistoryInput(Input):
An input with colors and stuff, plus an history
^R allows to search inside the history (as in a shell)
"""
- __slots__ = ('help_message', 'histo_pos', 'current_completed', 'search')
+ __slots__ = ('help_message', 'histo_pos', 'current_completed', 'search',
+ 'history')
- history: List[str] = []
+ global_history: ClassVar[List[str]] = []
def __init__(self) -> None:
Input.__init__(self)
@@ -604,8 +605,9 @@ class HistoryInput(Input):
self.key_func['^R'] = self.toggle_search
self.search = False
if config.getbool('separate_history'):
- # pylint: disable=assigning-non-slot
self.history: List[str] = []
+ else:
+ self.history = self.__class__.global_history
def toggle_search(self) -> None:
if self.help_message:
@@ -682,7 +684,7 @@ class MessageInput(HistoryInput):
Also letting the user enter colors or other text markups
"""
# The history is common to all MessageInput
- history: List[str] = []
+ global_history: ClassVar[List[str]] = []
def __init__(self) -> None:
HistoryInput.__init__(self)
@@ -728,7 +730,7 @@ class CommandInput(HistoryInput):
HelpMessage when a command is started
The on_input callback
"""
- history: List[str] = []
+ global_history: ClassVar[List[str]] = []
def __init__(self, help_message: str, on_abort, on_success, on_input=None) -> None:
HistoryInput.__init__(self)