mirror of
https://github.com/tiqi-group/pydase_service_base.git
synced 2025-04-20 00:20:01 +02:00
chore: formatting, adding type ignores
This commit is contained in:
parent
8906bf7996
commit
e0047e0c0a
@ -15,7 +15,9 @@ class IonizerServer:
|
|||||||
self, service: pydase.DataService, port: int, host: str, **kwargs: Any
|
self, service: pydase.DataService, port: int, host: str, **kwargs: Any
|
||||||
) -> None:
|
) -> None:
|
||||||
self.server = tiqi_rpc.Server(
|
self.server = tiqi_rpc.Server(
|
||||||
RPCInterface(service, **kwargs), host=host, port=port # type: ignore
|
RPCInterface(service, **kwargs),
|
||||||
|
host=host,
|
||||||
|
port=port, # type: ignore
|
||||||
)
|
)
|
||||||
|
|
||||||
def notify_Ionizer(parent_path: str, attr_name: str, value: Any) -> None:
|
def notify_Ionizer(parent_path: str, attr_name: str, value: Any) -> None:
|
||||||
@ -27,7 +29,7 @@ class IonizerServer:
|
|||||||
- value (Any): The value of the parameter.
|
- value (Any): The value of the parameter.
|
||||||
"""
|
"""
|
||||||
parent_path_list = parent_path.split(".")[1:] # without classname
|
parent_path_list = parent_path.split(".")[1:] # without classname
|
||||||
name = ".".join(parent_path_list + [attr_name])
|
name = ".".join([*parent_path_list, attr_name])
|
||||||
if isinstance(value, Enum):
|
if isinstance(value, Enum):
|
||||||
value = value.value
|
value = value.value
|
||||||
if isinstance(value, u.Quantity):
|
if isinstance(value, u.Quantity):
|
||||||
@ -44,7 +46,7 @@ class IonizerServer:
|
|||||||
)
|
)
|
||||||
|
|
||||||
service._callback_manager.add_notification_callback(notify_Ionizer)
|
service._callback_manager.add_notification_callback(notify_Ionizer)
|
||||||
self.server.install_signal_handlers = lambda: None
|
self.server.install_signal_handlers = lambda: None # type: ignore
|
||||||
|
|
||||||
async def serve(self) -> None:
|
async def serve(self) -> None:
|
||||||
await self.server.serve()
|
await self.server.serve()
|
||||||
|
@ -9,7 +9,7 @@ from pydase.utils.helpers import get_object_attr_from_path
|
|||||||
from pydase.version import __version__
|
from pydase.version import __version__
|
||||||
|
|
||||||
|
|
||||||
class RPCInterface(object):
|
class RPCInterface:
|
||||||
"""RPC interface to be passed to tiqi_rpc.Server to interface with Ionizer."""
|
"""RPC interface to be passed to tiqi_rpc.Server to interface with Ionizer."""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user