Remove some circular type imports.

This commit is contained in:
Emmanuel Gil Peyrot 2018-08-18 08:04:41 +01:00
parent 2abbf8274c
commit 73749091ae
2 changed files with 7 additions and 9 deletions

View file

@ -15,7 +15,6 @@ from typing import Union, Optional, List, Tuple
from datetime import datetime
from poezio.config import config
from poezio.theming import get_theme, dump_tuple
from poezio.windows import BaseTextWin
class Message:
@ -127,9 +126,9 @@ class TextBuffer:
# we keep track of one or more windows
# so we can pass the new messages to them, as they are added, so
# they (the windows) can build the lines from the new message
self._windows = [] # type: List[BaseTextWin]
self._windows = []
def add_window(self, win: BaseTextWin) -> None:
def add_window(self, win) -> None:
self._windows.append(win)
@property
@ -278,7 +277,7 @@ class TextBuffer:
log.debug('Replacing message %s with %s.', old_id, new_id)
return message
def del_window(self, win: BaseTextWin) -> None:
def del_window(self, win) -> None:
self._windows.remove(win)
def __del__(self):

View file

@ -11,15 +11,14 @@ log = logging.getLogger(__name__)
import curses
from poezio.config import config
from poezio.core import Core
from poezio.windows.base_wins import Win
from poezio.theming import get_theme, to_curses_attr
class GlobalInfoBar(Win):
def __init__(self, core: Core) -> None:
def __init__(self, core) -> None:
Win.__init__(self)
self.core = core # type: Core
self.core = core
def refresh(self) -> None:
log.debug('Refresh: %s', self.__class__.__name__)
@ -64,9 +63,9 @@ class GlobalInfoBar(Win):
class VerticalGlobalInfoBar(Win):
def __init__(self, core: Core, scr) -> None:
def __init__(self, core, scr) -> None:
Win.__init__(self)
self.core = core # type: Core
self.core = core
self._win = scr
def refresh(self) -> None: