diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-07-22 16:49:35 +0200 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-07-22 16:49:35 +0200 |
commit | c55759e0011f31123872ff385f0f87bba4c9f3fd (patch) | |
tree | 7a48fda5e5d6a9f15be8e6389ba9f595525557aa | |
parent | 8d0d59f332a5b5ad6754dc3a551f3899f55433c0 (diff) | |
download | poezio-c55759e0011f31123872ff385f0f87bba4c9f3fd.tar.gz poezio-c55759e0011f31123872ff385f0f87bba4c9f3fd.tar.bz2 poezio-c55759e0011f31123872ff385f0f87bba4c9f3fd.tar.xz poezio-c55759e0011f31123872ff385f0f87bba4c9f3fd.zip |
coucou
-rw-r--r-- | poezio/logger.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/poezio/logger.py b/poezio/logger.py index 22d05a49..e341af03 100644 --- a/poezio/logger.py +++ b/poezio/logger.py @@ -11,7 +11,7 @@ conversations and roster changes import mmap import re -from typing import List, Dict, Optional, TextIO, BinaryIO, Any +from typing import List, Dict, Optional, IO, Any from datetime import datetime from poezio import common @@ -74,9 +74,9 @@ class Logger: """ def __init__(self): - self._roster_logfile = None # Optional[TextIO] + self._roster_logfile = None # Optional[IO[Any]] # a dict of 'groupchatname': file-object (opened) - self._fds = {} # type: Dict[str, TextIO] + self._fds = {} # type: Dict[str, IO[Any]] def __del__(self): for opened_file in self._fds.values(): @@ -105,7 +105,7 @@ class Logger: log.debug('Log handle for %s re-created', room) return None - def _check_and_create_log_dir(self, room: str, open_fd: bool = True) -> Optional[TextIO]: + def _check_and_create_log_dir(self, room: str, open_fd: bool = True) -> Optional[IO[Any]]: """ Check that the directory where we want to log the messages exists. if not, create it @@ -279,7 +279,7 @@ def build_log_message(nick: str, msg: str, date: Optional[datetime] = None, typ: return logged_msg + ''.join(' %s\n' % line for line in lines) -def get_lines_from_fd(fd: BinaryIO, nb: int = 10) -> List[str]: +def get_lines_from_fd(fd: IO[Any], nb: int = 10) -> List[str]: """ Get the last log lines from a fileno """ |