mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-21 00:40:01 +02:00
updates render_in_frontend method (takes async functions into account)
This commit is contained in:
parent
d33e9f9dbf
commit
b6f6b3058e
@ -56,7 +56,12 @@ def frontend(func: Callable[..., Any]) -> Callable[..., Any]:
|
|||||||
|
|
||||||
|
|
||||||
def render_in_frontend(func: Callable[..., Any]) -> bool:
|
def render_in_frontend(func: Callable[..., Any]) -> bool:
|
||||||
"""Determines if the method is decorated with the `@frontend` decorator."""
|
"""Determines if the method should be rendered in the frontend.
|
||||||
|
|
||||||
|
It checks if the "@frontend" decorator was used or the method is a coroutine."""
|
||||||
|
|
||||||
|
if inspect.iscoroutine(func):
|
||||||
|
return True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return func._display_in_frontend # type: ignore
|
return func._display_in_frontend # type: ignore
|
||||||
|
Loading…
x
Reference in New Issue
Block a user