ci: fix mypy analysis

This commit is contained in:
mathieui 2022-01-29 23:36:21 +01:00
parent 13c731dfe3
commit 9cc861eeff
2 changed files with 9 additions and 7 deletions

View file

@ -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

View file

@ -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)