From 4527e9f547434fc4c336064734007f0f42b0d256 Mon Sep 17 00:00:00 2001 From: Archmonger <16909269+Archmonger@users.noreply.github.com> Date: Sun, 1 Dec 2024 21:25:48 -0800 Subject: [PATCH] Quick formatting run --- docs/examples/python/configure_asgi.py | 10 ++++------ docs/examples/python/configure_asgi_middleware.py | 10 ++++------ docs/examples/python/django_css_external_link.py | 4 +--- docs/examples/python/use_mutation_args_kwargs.py | 3 +-- docs/examples/python/use_mutation_query_refetch.py | 4 +--- docs/examples/python/use_query.py | 4 +--- 6 files changed, 12 insertions(+), 23 deletions(-) diff --git a/docs/examples/python/configure_asgi.py b/docs/examples/python/configure_asgi.py index 88958140..8feb0ec2 100644 --- a/docs/examples/python/configure_asgi.py +++ b/docs/examples/python/configure_asgi.py @@ -13,9 +13,7 @@ from reactpy_django import REACTPY_WEBSOCKET_ROUTE # noqa: E402 -application = ProtocolTypeRouter( - { - "http": django_asgi_app, - "websocket": URLRouter([REACTPY_WEBSOCKET_ROUTE]), - } -) +application = ProtocolTypeRouter({ + "http": django_asgi_app, + "websocket": URLRouter([REACTPY_WEBSOCKET_ROUTE]), +}) diff --git a/docs/examples/python/configure_asgi_middleware.py b/docs/examples/python/configure_asgi_middleware.py index cd7b5a22..0c5a7214 100644 --- a/docs/examples/python/configure_asgi_middleware.py +++ b/docs/examples/python/configure_asgi_middleware.py @@ -9,9 +9,7 @@ # start from channels.auth import AuthMiddlewareStack # noqa: E402 -application = ProtocolTypeRouter( - { - "http": django_asgi_app, - "websocket": AuthMiddlewareStack(URLRouter([REACTPY_WEBSOCKET_ROUTE])), - } -) +application = ProtocolTypeRouter({ + "http": django_asgi_app, + "websocket": AuthMiddlewareStack(URLRouter([REACTPY_WEBSOCKET_ROUTE])), +}) diff --git a/docs/examples/python/django_css_external_link.py b/docs/examples/python/django_css_external_link.py index ac1d0fba..28eb3fca 100644 --- a/docs/examples/python/django_css_external_link.py +++ b/docs/examples/python/django_css_external_link.py @@ -4,8 +4,6 @@ @component def my_component(): return html.div( - html.link( - {"rel": "stylesheet", "href": "https://example.com/external-styles.css"} - ), + html.link({"rel": "stylesheet", "href": "https://example.com/external-styles.css"}), html.button("My Button!"), ) diff --git a/docs/examples/python/use_mutation_args_kwargs.py b/docs/examples/python/use_mutation_args_kwargs.py index 5483ccf6..9a4b1e0a 100644 --- a/docs/examples/python/use_mutation_args_kwargs.py +++ b/docs/examples/python/use_mutation_args_kwargs.py @@ -3,8 +3,7 @@ from reactpy_django.hooks import use_mutation -def example_mutation(value: int, other_value: bool = False): - ... +def example_mutation(value: int, other_value: bool = False): ... @component diff --git a/docs/examples/python/use_mutation_query_refetch.py b/docs/examples/python/use_mutation_query_refetch.py index 8dc9fac0..40d4100a 100644 --- a/docs/examples/python/use_mutation_query_refetch.py +++ b/docs/examples/python/use_mutation_query_refetch.py @@ -27,9 +27,7 @@ def submit_event(event): elif item_query.error or not item_query.data: rendered_items = html.h2("Error when loading!") else: - rendered_items = html.ul( - html.li(item.text, key=item.pk) for item in item_query.data - ) + rendered_items = html.ul(html.li(item.text, key=item.pk) for item in item_query.data) # Handle all possible mutation states if item_mutation.loading: diff --git a/docs/examples/python/use_query.py b/docs/examples/python/use_query.py index d25a8cb0..9cadbd25 100644 --- a/docs/examples/python/use_query.py +++ b/docs/examples/python/use_query.py @@ -18,8 +18,6 @@ def todo_list(): elif item_query.error or not item_query.data: rendered_items = html.h2("Error when loading!") else: - rendered_items = html.ul( - [html.li(item.text, key=item.pk) for item in item_query.data] - ) + rendered_items = html.ul([html.li(item.text, key=item.pk) for item in item_query.data]) return html.div("Rendered items: ", rendered_items)