From c0b25c0581d68077ecb61e52e0d4a897e3213269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Wed, 3 Apr 2024 10:47:46 +0200 Subject: [PATCH] adds Client to default exports of pydase --- src/pydase/__init__.py | 2 ++ src/pydase/client/__init__.py | 3 +++ src/pydase/client/client.py | 5 ++--- src/pydase/client/proxy_class_factory.py | 6 +++--- src/pydase/components/device_connection.py | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/pydase/__init__.py b/src/pydase/__init__.py index 80448d4..ee37039 100644 --- a/src/pydase/__init__.py +++ b/src/pydase/__init__.py @@ -1,3 +1,4 @@ +from pydase.client.client import Client from pydase.data_service import DataService from pydase.server import Server from pydase.utils.logging import setup_logging @@ -7,4 +8,5 @@ setup_logging() __all__ = [ "DataService", "Server", + "Client", ] diff --git a/src/pydase/client/__init__.py b/src/pydase/client/__init__.py index e69de29..320df77 100644 --- a/src/pydase/client/__init__.py +++ b/src/pydase/client/__init__.py @@ -0,0 +1,3 @@ +from pydase.client.client import Client + +__all__ = ["Client"] diff --git a/src/pydase/client/client.py b/src/pydase/client/client.py index 3a7543c..4782951 100644 --- a/src/pydase/client/client.py +++ b/src/pydase/client/client.py @@ -5,7 +5,7 @@ from typing import Any, TypedDict, cast import socketio # type: ignore -import pydase +import pydase.data_service from pydase.client.proxy_class_factory import ProxyClassFactory, ProxyConnection from pydase.utils.helpers import is_property_attribute from pydase.utils.serialization.deserializer import loads @@ -24,7 +24,7 @@ class NotifyDict(TypedDict): data: NotifyDataDict -class Client(pydase.DataService): +class Client(pydase.data_service.DataService): def __init__(self, hostname: str, port: int): super().__init__() self._hostname = hostname @@ -93,7 +93,6 @@ class Client(pydase.DataService): and not is_property_attribute(self, changed_attribute) and all(part[0] != "_" for part in changed_attribute.split(".")) ): - logger.debug(f"{changed_attribute}: {value}") async def update_value() -> None: await self._sio.call( diff --git a/src/pydase/client/proxy_class_factory.py b/src/pydase/client/proxy_class_factory.py index 70a20e6..902cfe3 100644 --- a/src/pydase/client/proxy_class_factory.py +++ b/src/pydase/client/proxy_class_factory.py @@ -6,8 +6,8 @@ from typing import Any, cast import socketio # type: ignore -import pydase import pydase.components +import pydase.data_service import pydase.observer_pattern.observer from pydase.utils.helpers import is_property_attribute from pydase.utils.serialization.deserializer import Deserializer, loads @@ -36,7 +36,7 @@ class ProxyClassMixin: super().__setattr__(key, value) -class ProxyBaseClass(pydase.DataService, ProxyClassMixin): +class ProxyBaseClass(pydase.data_service.DataService, ProxyClassMixin): pass @@ -118,7 +118,7 @@ class ProxyClassFactory: def _deserialize_component_type( self, serialized_object: SerializedObject, base_class: type - ) -> pydase.DataService: + ) -> pydase.data_service.DataService: def add_prefix_to_last_path_element(s: str, prefix: str) -> str: parts = s.split(".") parts[-1] = f"{prefix}_{parts[-1]}" diff --git a/src/pydase/components/device_connection.py b/src/pydase/components/device_connection.py index bf50c99..2a941fe 100644 --- a/src/pydase/components/device_connection.py +++ b/src/pydase/components/device_connection.py @@ -1,9 +1,9 @@ import asyncio -import pydase +import pydase.data_service -class DeviceConnection(pydase.DataService): +class DeviceConnection(pydase.data_service.DataService): """ Base class for device connection management within the pydase framework.