Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Nov 15, 2024
1 parent d887943 commit 19b786f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion panel/io/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async def wrapped(*args, **kw):
except Exception as e:
state._handle_exception(e)
if unlock:
wrapper.nolock = True # type: ignore
wrapped.nolock = True # type: ignore
state.curdoc.add_next_tick_callback(wrapped)

param.parameterized.async_executor = async_execute
Expand Down
14 changes: 7 additions & 7 deletions panel/links.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import weakref

from typing import (
TYPE_CHECKING, Any, Iterable, Sequence,
TYPE_CHECKING, Any, Iterable, Sequence, TypeAlias,
)

import param
Expand All @@ -27,9 +27,9 @@

try:
from holoviews.core.dimension import Dimensioned
JSLinkTarget = Reactive | BkModel | Dimensioned
JSLinkTarget: TypeAlias = Reactive | BkModel | Dimensioned
except Exception:
JSLinkTarget = Reactive | BkModel # type: ignore
JSLinkTarget: TypeAlias = Reactive | BkModel # type: ignore
SourceModelSpec = tuple[str | None, str]
TargetModelSpec = tuple[str | None, str | None]

Expand Down Expand Up @@ -111,18 +111,18 @@ class Callback(param.Parameterized):
snippet to be executed if the source property changes.""")

# Mapping from a source id to a Link instance
registry: weakref.WeakKeyDictionary[Reactive | BkModel, list['Callback']] = weakref.WeakKeyDictionary()
registry: weakref.WeakKeyDictionary[Reactive | BkModel, list[Callback]] = weakref.WeakKeyDictionary()

# Mapping to define callbacks by backend and Link type.
# e.g. Callback._callbacks[Link] = Callback
_callbacks: dict[type['Callback'], type['CallbackGenerator']] = {}
_callbacks: dict[type[Callback], type[CallbackGenerator]] = {}

# Whether the link requires a target
_requires_target: bool = False

def __init__(
self, source: Reactive, target: JSLinkTarget = None,
args: dict[str, Any] | None = None, code: dict[str, str] = None,
self, source: Reactive, target: JSLinkTarget | None = None,
args: dict[str, Any] | None = None, code: dict[str, str] | None = None,
**params
):
"""
Expand Down
1 change: 1 addition & 0 deletions panel/widgets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def _get_embed_state(
js_getter: string
JS snippet that returns the state value given the model
"""
raise NotImplementedError()


class CompositeWidget(Widget):
Expand Down

0 comments on commit 19b786f

Please sign in to comment.