Skip to content
Snippets Groups Projects

Beekeepy: Add session holder class and session token handling

Merged Krzysztof Mochocki requested to merge kmochocki/beekeepy into develop
Compare and Show latest version
2 files
+ 1
10
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -3,7 +3,6 @@ from __future__ import annotations
import asyncio
import time
from abc import ABC, abstractmethod
from contextlib import contextmanager
from typing import TYPE_CHECKING
from helpy._communication.settings import CommunicationSettings
@@ -11,8 +10,6 @@ from helpy._interfaces.settings_holder import SharedSettingsHolder
from helpy.exceptions import CommunicationError
if TYPE_CHECKING:
from collections.abc import Iterator
from helpy._interfaces.url import HttpUrl
@@ -52,9 +49,3 @@ class AbstractCommunicator(SharedSettingsHolder[CommunicationSettings], ABC):
if not (ok_status_code_lower_bound <= status_code <= ok_status_code_upper_bound):
raise CommunicationError(f"{status_code=}", f"{sent=}", f"{received=}")
@contextmanager
def restore_settings(self) -> Iterator[None]:
before = self.settings.copy()
yield
self.__settings = before
Loading