Skip to content

Commit 353eacd

Browse files
committed
run auto formatter on docs examples
1 parent 99ca260 commit 353eacd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+82
-59
lines changed

docs/examples/python/configure-asgi-middleware.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Broken load order, only used for linting
22
from channels.routing import ProtocolTypeRouter, URLRouter
3+
34
from reactpy_django import REACTPY_WEBSOCKET_ROUTE
45

56
django_asgi_app = ""

docs/examples/python/configure-asgi.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111

1212
from channels.routing import ProtocolTypeRouter, URLRouter # noqa: E402
13+
1314
from reactpy_django import REACTPY_WEBSOCKET_ROUTE # noqa: E402
1415

1516
application = ProtocolTypeRouter(

docs/examples/python/django-css.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.components import django_css
34

45

docs/examples/python/django-js.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.components import django_js
34

45

docs/examples/python/django-query-postprocessor.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from example.models import TodoItem
21
from reactpy import component
2+
3+
from example.models import TodoItem
34
from reactpy_django.hooks import use_query
45
from reactpy_django.utils import django_query_postprocessor
56

docs/examples/python/django-router.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from reactpy import component, html
2-
from reactpy_django.router import django_router
32
from reactpy_router import route
43

4+
from reactpy_django.router import django_router
5+
56

67
@component
78
def my_component():
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
def child_component(): ...

docs/examples/python/example/urls.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from django.urls import path
2+
23
from example import views
34

45
urlpatterns = [

docs/examples/python/example/views.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from django.shortcuts import render
1+
from python.hello_world_cbv import HelloWorld
2+
from python.hello_world_fbv import hello_world
23

3-
4-
def index(request):
5-
return render(request, "my_template.html")
4+
__all__ = ["HelloWorld", "hello_world"]

docs/examples/python/first_view.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.shortcuts import render
2+
3+
4+
def index(request):
5+
return render(request, "my_template.html")

docs/examples/python/hello_world_app_config_cbv.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from django.apps import AppConfig
2-
from reactpy_django.utils import register_iframe
32

4-
from . import views
3+
from example import views
4+
from reactpy_django.utils import register_iframe
55

66

77
class ExampleAppConfig(AppConfig):

docs/examples/python/hello_world_app_config_fbv.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from django.apps import AppConfig
2-
from reactpy_django.utils import register_iframe
32

4-
from . import views
3+
from example import views
4+
from reactpy_django.utils import register_iframe
55

66

77
class ExampleAppConfig(AppConfig):

docs/examples/python/pyscript-component-initial-object.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.components import pyscript_component
34

45

docs/examples/python/pyscript-component-initial-string.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.components import pyscript_component
34

45

docs/examples/python/pyscript-component-multiple-files-root.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.components import pyscript_component
34

45

docs/examples/python/pyscript-component-root.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.components import pyscript_component
34

45

docs/examples/python/pyscript-multiple-files-root.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
from typing import TYPE_CHECKING
2-
31
from reactpy import component, html
42

5-
if TYPE_CHECKING:
6-
from .child import child_component
3+
from example.components import child_component
74

85

96
@component

docs/examples/python/pyscript-ssr-parent.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.components import pyscript_component
34

45

docs/examples/python/pyscript-tag.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.html import pyscript
34

45
example_source_code = """

docs/examples/python/register-component.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from django.apps import AppConfig
2+
23
from reactpy_django.utils import register_component
34

45

docs/examples/python/use-channel-layer-group.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, hooks, html
2+
23
from reactpy_django.hooks import use_channel_layer
34

45

docs/examples/python/use-channel-layer-signal-receiver.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, hooks, html
2+
23
from reactpy_django.hooks import use_channel_layer
34

45

docs/examples/python/use-channel-layer.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, hooks, html
2+
23
from reactpy_django.hooks import use_channel_layer
34

45

docs/examples/python/use-connection.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.hooks import use_connection
34

45

docs/examples/python/use-location.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.hooks import use_location
34

45

docs/examples/python/use-mutation-args-kwargs.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component
2+
23
from reactpy_django.hooks import use_mutation
34

45

@@ -11,5 +12,3 @@ def my_component():
1112
mutation = use_mutation(example_mutation)
1213

1314
mutation(123, other_value=True)
14-
15-
...

docs/examples/python/use-mutation-query-refetch.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from example.models import TodoItem
21
from reactpy import component, html
2+
3+
from example.models import TodoItem
34
from reactpy_django.hooks import use_mutation, use_query
45

56

docs/examples/python/use-mutation-reset.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from example.models import TodoItem
21
from reactpy import component, html
2+
3+
from example.models import TodoItem
34
from reactpy_django.hooks import use_mutation
45

56

docs/examples/python/use-mutation-thread-sensitive.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from reactpy import component, html
2+
23
from reactpy_django.hooks import use_mutation
34

45

56
def execute_thread_safe_mutation(text):
67
"""This is an example mutation function that does some thread-safe operation."""
7-
pass
88

99

1010
@component

docs/examples/python/use-mutation.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from example.models import TodoItem
21
from reactpy import component, html
2+
3+
from example.models import TodoItem
34
from reactpy_django.hooks import use_mutation
45

56

docs/examples/python/use-origin.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.hooks import use_origin
34

45

docs/examples/python/use-query-args.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component
2+
23
from reactpy_django.hooks import use_query
34

45

docs/examples/python/use-query-postprocessor-change.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component
2+
23
from reactpy_django.hooks import use_query
34

45

@@ -11,7 +12,6 @@ def my_postprocessor(data, example_kwarg=True):
1112

1213
def execute_io_intensive_operation():
1314
"""This is an example query function that does something IO intensive."""
14-
pass
1515

1616

1717
@component

docs/examples/python/use-query-postprocessor-disable.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from reactpy import component
2+
23
from reactpy_django.hooks import use_query
34

45

56
def execute_io_intensive_operation():
67
"""This is an example query function that does something IO intensive."""
7-
pass
88

99

1010
@component

docs/examples/python/use-query-postprocessor-kwargs.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from example.models import TodoItem
21
from reactpy import component
2+
3+
from example.models import TodoItem
34
from reactpy_django.hooks import use_query
45

56

docs/examples/python/use-query-thread-sensitive.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from reactpy import component
2+
23
from reactpy_django.hooks import use_query
34

45

56
def execute_thread_safe_operation():
67
"""This is an example query function that does some thread-safe operation."""
7-
pass
88

99

1010
@component

docs/examples/python/use-query.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from channels.db import database_sync_to_async
2-
from example.models import TodoItem
32
from reactpy import component, html
3+
4+
from example.models import TodoItem
45
from reactpy_django.hooks import use_query
56

67

docs/examples/python/use-root-id.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.hooks import use_root_id
34

45

docs/examples/python/use-scope.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.hooks import use_scope
34

45

docs/examples/python/use-user-data-defaults.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.hooks import use_user_data
34

45

docs/examples/python/use-user-data.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.hooks import use_user_data
34

45

docs/examples/python/use-user.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.hooks import use_user
34

45

docs/examples/python/user-passes-test-component-fallback.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.decorators import user_passes_test
34

45

docs/examples/python/user-passes-test-vdom-fallback.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.decorators import user_passes_test
34

45

docs/examples/python/user-passes-test.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html
2+
23
from reactpy_django.decorators import user_passes_test
34

45

docs/examples/python/views.py

-7
This file was deleted.

docs/examples/python/vtc-args.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from django.http import HttpRequest
22
from reactpy import component, html
3-
from reactpy_django.components import view_to_component
43

5-
from . import views
4+
from example import views
5+
from reactpy_django.components import view_to_component
66

77
hello_world_component = view_to_component(views.hello_world)
88

docs/examples/python/vtc-cbv.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from reactpy import component, html
2-
from reactpy_django.components import view_to_component
32

4-
from . import views
3+
from example import views
4+
from reactpy_django.components import view_to_component
55

66
hello_world_component = view_to_component(views.HelloWorld.as_view())
77

docs/examples/python/vtc-strict-parsing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from reactpy import component, html
2-
from reactpy_django.components import view_to_component
32

4-
from . import views
3+
from example import views
4+
from reactpy_django.components import view_to_component
55

66
hello_world_component = view_to_component(views.hello_world)
77

docs/examples/python/vtc-transforms.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from reactpy import component, html
2-
from reactpy_django.components import view_to_component
32

4-
from . import views
3+
from example import views
4+
from reactpy_django.components import view_to_component
55

66

77
def example_transform(vdom):
@@ -10,9 +10,7 @@ def example_transform(vdom):
1010
vdom["children"][0] = "Farewell World!"
1111

1212

13-
hello_world_component = view_to_component(
14-
views.hello_world, transforms=[example_transform]
15-
)
13+
hello_world_component = view_to_component(views.hello_world, transforms=[example_transform])
1614

1715

1816
@component

0 commit comments

Comments
 (0)