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
4 files
+ 22
15
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -20,7+20,7 @@
from loguru import Logger
from helpy._communication.abc.communicator import AbstractCommunicator
from helpy._handles.abc.api_collection import AbstractAsyncApiCollection, AbstractSyncApiCollection
from helpy._handles.batch_handle import AsyncBatchHandle, SyncBatchHandle
from helpy._interfaces.url import HttpUrl
@@ -59,7+59,7 @@
def http_endpoint(self, value: HttpUrl) -> None:
"""Set http endpoint."""
self.logger.debug(f"setting http endpoint to: {value.as_string()}")
self.settings.http_endpoint = value
with self.update_settings() as settings:
settings.http_endpoint = value
@property
def api(self) -> AbstractAsyncApiCollection | AbstractSyncApiCollection:
@@ -196,7 +197,7 @@ class AbstractAsyncHandle(AbstractHandle, ABC):
return True
def _get_recommended_communicator(self) -> AbstractCommunicator:
return AioHttpCommunicator(settings=self._get_settings_for_other_holder())
return AioHttpCommunicator(settings=self._settings)
@abstractmethod
async def batch(self, *, delay_error_on_data_access: bool = False) -> AsyncBatchHandle[Any]:
@@ -222,7 +223,7 @@ class AbstractSyncHandle(AbstractHandle, ABC):
return False
def _get_recommended_communicator(self) -> AbstractCommunicator:
return RequestCommunicator(settings=self._get_settings_for_other_holder())
return RequestCommunicator(settings=self._settings)
@abstractmethod
def batch(self, *, delay_error_on_data_access: bool = False) -> SyncBatchHandle[Any]:
Loading