From 4d9fa751f05c2058191806e5f7f0a9f739423617 Mon Sep 17 00:00:00 2001 From: WassCodeur Date: Tue, 30 Jul 2024 20:57:50 +0000 Subject: [PATCH] NF: Implementation of lazy loading in `fury.stream.server` --- fury/stream/__init__.pyi | 9 ++++++++- fury/stream/server/__init__.py | 4 ++-- fury/stream/server/__init__.pyi | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 fury/stream/server/__init__.pyi diff --git a/fury/stream/__init__.pyi b/fury/stream/__init__.pyi index 8ebec07b2..c1dc81234 100644 --- a/fury/stream/__init__.pyi +++ b/fury/stream/__init__.pyi @@ -17,9 +17,16 @@ __all__ = [ "Widget", "check_port_is_available", "server", + "client", + "tools", ] -from . import server +from . import ( + client, + server, + tools, + widget as widget, +) from .client import FuryStreamClient, FuryStreamInteraction, interaction_callback from .tools import ( ArrayCircularQueue, diff --git a/fury/stream/server/__init__.py b/fury/stream/server/__init__.py index af5b0e0ce..62d86f776 100644 --- a/fury/stream/server/__init__.py +++ b/fury/stream/server/__init__.py @@ -1,3 +1,3 @@ -from fury.stream.server.main import web_server, web_server_raw_array +import lazy_loader as lazy -__all__ = ["web_server", "web_server_raw_array"] +__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__) diff --git a/fury/stream/server/__init__.pyi b/fury/stream/server/__init__.pyi new file mode 100644 index 000000000..1947f3dcc --- /dev/null +++ b/fury/stream/server/__init__.pyi @@ -0,0 +1,22 @@ +__all__ = ["async_app", "main"] +from . import ( + async_app, + main, +) +from .async_app import ( + get_app as get_app, + index as index, + javascript as javascript, + mjpeg_handler as mjpeg_handler, + offer as offer, + on_shutdown as on_shutdown, + set_mouse as set_mouse, + set_mouse_click as set_mouse_click, + set_weel as set_weel, + websocket_handler as websocket_handler, +) +from .main import ( + RTCServer as RTCServer, + web_server as web_server, + web_server_raw_array as web_server_raw_array, +)