Skip to content

Commit b58cb20

Browse files
committed
make format
1 parent 017298f commit b58cb20

File tree

37 files changed

+146
-154
lines changed

37 files changed

+146
-154
lines changed

examples/airmass/location.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ def location_server(
5858
},
5959
{maximumAge: Infinity, timeout: Infinity}
6060
)
61-
""".replace(
62-
"#HERE#", module.resolve_id("here")
63-
)
61+
""".replace("#HERE#", module.resolve_id("here"))
6462
),
6563
selector="body",
6664
where="beforeEnd",

examples/brownian/shinymediapipe/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ._hand import dependencies, input_hand, hand_options
1+
from ._hand import dependencies, hand_options, input_hand
22

33
__all__ = (
44
"dependencies",

examples/model-score/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ def value_boxes():
198198
theme=(
199199
"text-success"
200200
if score > THRESHOLD_MID
201-
else "text-warning" if score > THRESHOLD_LOW else "bg-danger"
201+
else "text-warning"
202+
if score > THRESHOLD_LOW
203+
else "bg-danger"
202204
),
203205
)
204206
for model, score in scores_by_model.items()

shiny/_app.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@
3939
# Default values for App options.
4040
LIB_PREFIX: str = "lib/"
4141
SANITIZE_ERRORS: bool = False
42-
SANITIZE_ERROR_MSG: str = (
43-
"An error has occurred. Check your logs or contact the app author for clarification."
44-
)
42+
SANITIZE_ERROR_MSG: str = "An error has occurred. Check your logs or contact the app author for clarification."
4543

4644

4745
class App:
@@ -96,9 +94,7 @@ def server(input: Inputs, output: Outputs, session: Session):
9694
may default to ``True`` in some production environments (e.g., Posit Connect).
9795
"""
9896

99-
sanitize_error_msg: str = (
100-
"An error has occurred. Check your logs or contact the app author for clarification."
101-
)
97+
sanitize_error_msg: str = "An error has occurred. Check your logs or contact the app author for clarification."
10298
"""
10399
The message to show when an error occurs and ``SANITIZE_ERRORS=True``.
104100
"""
@@ -512,7 +508,7 @@ def noop_server_fn(input: Inputs, output: Outputs, session: Session) -> None:
512508

513509

514510
def wrap_server_fn_with_output_session(
515-
server: Callable[[Inputs], None]
511+
server: Callable[[Inputs], None],
516512
) -> Callable[[Inputs, Outputs, Session], None]:
517513
def _server(input: Inputs, output: Outputs, session: Session):
518514
# Only has 1 parameter, ignore output, session

shiny/_autoreload.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ async def _() -> None:
7676
}
7777
try:
7878
async with websockets.connect(
79-
url, **options # pyright: ignore[reportArgumentType]
79+
url,
80+
**options, # pyright: ignore[reportArgumentType]
8081
) as websocket:
8182
await websocket.send("reload_end")
8283
except websockets.exceptions.ConnectionClosed:
@@ -110,9 +111,7 @@ def __init__(
110111
ws_url = autoreload_url()
111112
self.script = (
112113
f""" <script src="__shared/shiny-autoreload.js" data-ws-url="{html.escape(ws_url)}"></script>
113-
</head>""".encode(
114-
"ascii"
115-
)
114+
</head>""".encode("ascii")
116115
if ws_url
117116
else bytes()
118117
)

shiny/_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def private_seed() -> Generator[None, None, None]:
246246

247247

248248
def wrap_async(
249-
fn: Callable[P, R] | Callable[P, Awaitable[R]]
249+
fn: Callable[P, R] | Callable[P, Awaitable[R]],
250250
) -> Callable[P, Awaitable[R]]:
251251
"""
252252
Given a synchronous function that returns R, return an async function that wraps the
@@ -322,7 +322,7 @@ async def fn_async(*args: P.args, **kwargs: P.kwargs) -> R:
322322
# This function should generally be used in this code base instead of
323323
# `iscoroutinefunction()`.
324324
def is_async_callable(
325-
obj: Callable[P, R] | Callable[P, Awaitable[R]]
325+
obj: Callable[P, R] | Callable[P, Awaitable[R]],
326326
) -> TypeGuard[Callable[P, Awaitable[R]]]:
327327
"""
328328
Determine if an object is an async function.

shiny/api-examples/nav_panel/app-core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def nav_controls(prefix: str) -> List[NavSetArg]:
6161
ui.navset_card_underline(*nav_controls("navset_card_underline()")),
6262
ui.h4("navset_pill_list()"),
6363
ui.navset_pill_list(*nav_controls("navset_pill_list()")),
64-
)
64+
),
6565
)
6666

6767

shiny/express/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
from __future__ import annotations
22

3+
from .. import render
4+
35
# Import these with underscore names so they won't show in autocomplete from the Python
46
# console.
57
from ..session import (
68
Inputs as _Inputs,
9+
)
10+
from ..session import (
711
Outputs as _Outputs,
12+
)
13+
from ..session import (
814
Session as _Session,
15+
)
16+
from ..session import (
917
get_current_session as _get_current_session,
1018
)
11-
from .. import render
1219
from . import ui
1320
from ._is_express import is_express_app
1421
from ._output import ( # noqa: F401
@@ -18,7 +25,6 @@
1825
from ._run import app_opts, wrap_express_app
1926
from .expressify_decorator import expressify
2027

21-
2228
__all__ = (
2329
"render",
2430
"input",

shiny/express/_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def wrapper(renderer: RendererT) -> RendererT:
4848

4949

5050
def suspend_display(
51-
fn: Callable[P, R] | RendererT | None = None
51+
fn: Callable[P, R] | RendererT | None = None,
5252
) -> Callable[P, R] | RendererT | AbstractContextManager[None]:
5353
warn_deprecated(
5454
"`suspend_display` is deprecated. Please use `ui.hold` instead. "

shiny/express/_recall_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def tagify(self) -> Tag | TagList | MetadataNode | str:
8181

8282

8383
def wrap_recall_context_manager(
84-
fn: Callable[P, R]
84+
fn: Callable[P, R],
8585
) -> Callable[P, RecallContextManager[R]]:
8686
@functools.wraps(fn)
8787
def wrapped_fn(*args: P.args, **kwargs: P.kwargs) -> RecallContextManager[R]:

0 commit comments

Comments
 (0)