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