Rename mock->stub

This commit is contained in:
Paul Nameless 2020-07-28 10:06:37 +08:00
parent 859de4a6d3
commit be1ae815d2
2 changed files with 3 additions and 4 deletions

View file

@ -158,7 +158,7 @@ def get_video_resolution(file_path: str) -> Tuple[int, int]:
def get_waveform(file_path: str) -> str: def get_waveform(file_path: str) -> str:
# mock for now # stub for now
waveform = (random.randint(0, 255) for _ in range(100)) waveform = (random.randint(0, 255) for _ in range(100))
packed = struct.pack("100B", *waveform) packed = struct.pack("100B", *waveform)
return base64.b64encode(packed).decode() return base64.b64encode(packed).decode()
@ -236,7 +236,7 @@ class suspend:
def __enter__(self) -> "suspend": def __enter__(self) -> "suspend":
for view in (self.view.chats, self.view.msgs, self.view.status): for view in (self.view.chats, self.view.msgs, self.view.status):
view._refresh = view.win.noutrefresh view._refresh = view.win.noutrefresh
self.view.resize_handler = self.view.resize_mock self.view.resize_handler = self.view.resize_stub
curses.echo() curses.echo()
curses.nocbreak() curses.nocbreak()
self.view.stdscr.keypad(False) self.view.stdscr.keypad(False)

View file

@ -4,7 +4,6 @@ from datetime import datetime
from typing import Any, Dict, List, Optional, Tuple, Union, cast from typing import Any, Dict, List, Optional, Tuple, Union, cast
from _curses import window # type: ignore from _curses import window # type: ignore
from tg import config from tg import config
from tg.colors import bold, cyan, get_color, magenta, reverse, white, yellow from tg.colors import bold, cyan, get_color, magenta, reverse, white, yellow
from tg.models import Model, UserModel from tg.models import Model, UserModel
@ -59,7 +58,7 @@ class View:
self.max_read = 2048 self.max_read = 2048
self.resize_handler = self.resize self.resize_handler = self.resize
def resize_mock(self) -> None: def resize_stub(self) -> None:
pass pass
def resize(self) -> None: def resize(self) -> None: