|
35 | 35 | safe_client_build_dir_path, |
36 | 36 | safe_web_modules_dir_path, |
37 | 37 | ) |
38 | | -from reactpy.backend.hooks import ConnectionContext |
39 | | -from reactpy.backend.hooks import use_connection as _use_connection |
| 38 | +from reactpy.core.hooks import ConnectionContext |
| 39 | +from reactpy.core.hooks import use_connection as _use_connection |
40 | 40 | from reactpy.backend.types import Connection, Location |
41 | 41 | from reactpy.core.serve import serve_layout |
42 | 42 | from reactpy.core.types import ComponentType, RootComponentConstructor |
@@ -70,7 +70,8 @@ def configure( |
70 | 70 | """ |
71 | 71 | options = options or Options() |
72 | 72 |
|
73 | | - api_bp = Blueprint(f"reactpy_api_{id(app)}", __name__, url_prefix=str(PATH_PREFIX)) |
| 73 | + api_bp = Blueprint(f"reactpy_api_{id(app)}", |
| 74 | + __name__, url_prefix=str(PATH_PREFIX)) |
74 | 75 | spa_bp = Blueprint( |
75 | 76 | f"reactpy_spa_{id(app)}", __name__, url_prefix=options.url_prefix |
76 | 77 | ) |
@@ -192,14 +193,15 @@ def recv() -> Any: |
192 | 193 | _dispatch_in_thread( |
193 | 194 | ws, |
194 | 195 | # remove any url prefix from path |
195 | | - path[len(options.url_prefix) :], |
| 196 | + path[len(options.url_prefix):], |
196 | 197 | constructor(), |
197 | 198 | send, |
198 | 199 | recv, |
199 | 200 | ) |
200 | 201 |
|
201 | 202 | sock.route(STREAM_PATH.name, endpoint="without_path")(model_stream) |
202 | | - sock.route(f"{STREAM_PATH.name}/<path:path>", endpoint="with_path")(model_stream) |
| 203 | + sock.route(f"{STREAM_PATH.name}/<path:path>", |
| 204 | + endpoint="with_path")(model_stream) |
203 | 205 |
|
204 | 206 |
|
205 | 207 | def _dispatch_in_thread( |
@@ -260,7 +262,8 @@ async def main() -> None: |
260 | 262 | Thread(target=run_dispatcher, daemon=True).start() |
261 | 263 |
|
262 | 264 | dispatch_thread_info_created.wait() |
263 | | - dispatch_thread_info = cast(_DispatcherThreadInfo, dispatch_thread_info_ref.current) |
| 265 | + dispatch_thread_info = cast( |
| 266 | + _DispatcherThreadInfo, dispatch_thread_info_ref.current) |
264 | 267 |
|
265 | 268 | if dispatch_thread_info is None: |
266 | 269 | raise RuntimeError("Failed to create dispatcher thread") # nocov |
|
0 commit comments