Skip to content

Commit f1bf70c

Browse files
committed
camelCase to snake_case + rewrite util
1 parent 7ee7b98 commit f1bf70c

File tree

42 files changed

+452
-233
lines changed

Some content is hidden

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

42 files changed

+452
-233
lines changed

docs/source/guides/adding-interactivity/components-with-state/_examples/adding_state_variable/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def handle_click(event):
2525
url = sculpture["url"]
2626

2727
return html.div(
28-
html.button({"onClick": handle_click}, "Next"),
28+
html.button({"on_click": handle_click}, "Next"),
2929
html.h2(name, " by ", artist),
3030
html.p(f"({bounded_index + 1} of {len(sculpture_data)})"),
3131
html.img({"src": url, "alt": alt, "style": {"height": "200px"}}),

docs/source/guides/adding-interactivity/components-with-state/_examples/isolated_state/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ def handle_more_click(event):
2929
url = sculpture["url"]
3030

3131
return html.div(
32-
html.button({"onClick": handle_next_click}, "Next"),
32+
html.button({"on_click": handle_next_click}, "Next"),
3333
html.h2(name, " by ", artist),
3434
html.p(f"({bounded_index + 1} or {len(sculpture_data)})"),
3535
html.img({"src": url, "alt": alt, "style": {"height": "200px"}}),
3636
html.div(
3737
html.button(
38-
{"onClick": handle_more_click},
39-
f"{'Show' if show_more else 'Hide'} details",
38+
{"on_click": handle_more_click},
39+
f"{('Show' if show_more else 'Hide')} details",
4040
),
4141
(html.p(description) if show_more else ""),
4242
),

docs/source/guides/adding-interactivity/components-with-state/_examples/multiple_state_variables/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ def handle_more_click(event):
2929
url = sculpture["url"]
3030

3131
return html.div(
32-
html.button({"onClick": handle_next_click}, "Next"),
32+
html.button({"on_click": handle_next_click}, "Next"),
3333
html.h2(name, " by ", artist),
3434
html.p(f"({bounded_index + 1} or {len(sculpture_data)})"),
3535
html.img({"src": url, "alt": alt, "style": {"height": "200px"}}),
3636
html.div(
3737
html.button(
38-
{"onClick": handle_more_click},
39-
f"{'Show' if show_more else 'Hide'} details",
38+
{"on_click": handle_more_click},
39+
f"{('Show' if show_more else 'Hide')} details",
4040
),
4141
(html.p(description) if show_more else ""),
4242
),

docs/source/guides/adding-interactivity/components-with-state/_examples/when_variables_are_not_enough/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def handle_click(event):
3131
url = sculpture["url"]
3232

3333
return html.div(
34-
html.button({"onClick": handle_click}, "Next"),
34+
html.button({"on_click": handle_click}, "Next"),
3535
html.h2(name, " by ", artist),
3636
html.p(f"({bounded_index + 1} or {len(sculpture_data)})"),
3737
html.img({"src": url, "alt": alt, "style": {"height": "200px"}}),

docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_remove.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ def handle_click(event):
2626
return handle_click
2727

2828
return html.div(
29-
html.button({"onClick": handle_add_click}, "add term"),
29+
html.button({"on_click": handle_add_click}, "add term"),
3030
html.label(
3131
"Term: ",
32-
html.input({"value": term_to_add, "onChange": handle_term_to_add_change}),
32+
html.input({"value": term_to_add, "on_change": handle_term_to_add_change}),
3333
),
3434
html.label(
3535
"Definition: ",
3636
html.input(
3737
{
3838
"value": definition_to_add,
39-
"onChange": handle_definition_to_add_change,
39+
"on_change": handle_definition_to_add_change,
4040
}
4141
),
4242
),
@@ -45,7 +45,7 @@ def handle_click(event):
4545
html.div(
4646
{"key": term},
4747
html.button(
48-
{"onClick": make_delete_click_handler(term)}, "delete term"
48+
{"on_click": make_delete_click_handler(term)}, "delete term"
4949
),
5050
html.dt(term),
5151
html.dd(definition),

docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_update.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,18 @@ def handle_email_change(event):
2424
html.label(
2525
"First name: ",
2626
html.input(
27-
{"value": person["first_name"], "onChange": handle_first_name_change},
27+
{"value": person["first_name"], "on_change": handle_first_name_change}
2828
),
2929
),
3030
html.label(
3131
"Last name: ",
3232
html.input(
33-
{"value": person["last_name"], "onChange": handle_last_name_change},
33+
{"value": person["last_name"], "on_change": handle_last_name_change}
3434
),
3535
),
3636
html.label(
3737
"Email: ",
38-
html.input(
39-
{"value": person["email"], "onChange": handle_email_change},
40-
),
38+
html.input({"value": person["email"], "on_change": handle_email_change}),
4139
),
4240
html.p(f"{person['first_name']} {person['last_name']} {person['email']}"),
4341
)

docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_insert.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def handle_click(event):
1616

1717
return html.div(
1818
html.h1("Inspiring sculptors:"),
19-
html.input({"value": artist_to_add, "onChange": handle_change}),
20-
html.button({"onClick": handle_click}, "add"),
19+
html.input({"value": artist_to_add, "on_change": handle_change}),
20+
html.button({"on_click": handle_click}, "add"),
2121
html.ul([html.li({"key": name}, name) for name in artists]),
2222
)
2323

docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_re_order.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def handle_reverse_click(event):
1515

1616
return html.div(
1717
html.h1("Inspiring sculptors:"),
18-
html.button({"onClick": handle_sort_click}, "sort"),
19-
html.button({"onClick": handle_reverse_click}, "reverse"),
18+
html.button({"on_click": handle_sort_click}, "sort"),
19+
html.button({"on_click": handle_reverse_click}, "reverse"),
2020
html.ul([html.li({"key": name}, name) for name in artists]),
2121
)
2222

docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_remove.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ def handle_click(event):
2424

2525
return html.div(
2626
html.h1("Inspiring sculptors:"),
27-
html.input({"value": artist_to_add, "onChange": handle_change}),
28-
html.button({"onClick": handle_add_click}, "add"),
27+
html.input({"value": artist_to_add, "on_change": handle_change}),
28+
html.button({"on_click": handle_add_click}, "add"),
2929
html.ul(
3030
[
3131
html.li(
3232
{"key": name},
3333
name,
34-
html.button({"onClick": make_handle_delete_click(index)}, "delete"),
34+
html.button(
35+
{"on_click": make_handle_delete_click(index)}, "delete"
36+
),
3537
)
3638
for index, name in enumerate(artists)
3739
]

docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_replace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def handle_click(event):
1717
html.li(
1818
{"key": index},
1919
count,
20-
html.button({"onClick": make_increment_click_handler(index)}, "+1"),
20+
html.button({"on_click": make_increment_click_handler(index)}, "+1"),
2121
)
2222
for index, count in enumerate(counters)
2323
]

0 commit comments

Comments
 (0)