From d506235a8b6e444a9e1f0ceb1430ba04df014da5 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 3 Jul 2022 17:07:35 -0400 Subject: [PATCH] Drop token attr from `NoBsWs` --- piker/data/_web_bs.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/piker/data/_web_bs.py b/piker/data/_web_bs.py index 820d5054..9c3fa796 100644 --- a/piker/data/_web_bs.py +++ b/piker/data/_web_bs.py @@ -53,13 +53,11 @@ class NoBsWs: def __init__( self, url: str, - token: str, stack: AsyncExitStack, fixture: Callable, serializer: ModuleType = json, ): self.url = url - self.token = token self.fixture = fixture self._stack = stack self._ws: 'WebSocketConnection' = None # noqa @@ -83,14 +81,9 @@ class NoBsWs: trio_websocket.open_websocket_url(self.url) ) # rerun user code fixture - if self.token == '': - ret = await self._stack.enter_async_context( - self.fixture(self) - ) - else: - ret = await self._stack.enter_async_context( - self.fixture(self, self.token) - ) + ret = await self._stack.enter_async_context( + self.fixture(self) + ) assert ret is None @@ -135,14 +128,13 @@ async def open_autorecon_ws( # TODO: proper type annot smh fixture: Callable, - # used for authenticated websockets - token: str = '', + ) -> AsyncGenerator[tuple[...], NoBsWs]: """Apparently we can QoS for all sorts of reasons..so catch em. """ async with AsyncExitStack() as stack: - ws = NoBsWs(url, token, stack, fixture=fixture) + ws = NoBsWs(url, stack, fixture=fixture) await ws._connect() try: