Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed May 12, 2022
1 parent 5eb4a48 commit da70943
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
12 changes: 8 additions & 4 deletions panel/reactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@
import re
import sys
import textwrap

from collections import Counter, defaultdict, namedtuple
from functools import partial
from pprint import pformat
from typing import (TYPE_CHECKING, Any, Callable, Dict, Iterable, List,
Mapping, Optional, Set, Tuple, Type, Union)
from typing import (
TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Mapping, Optional,
Set, Tuple, Type, Union
)

import bleach
import numpy as np
from bokeh.model import DataModel
import param

import param # type: ignore
from bokeh.model import DataModel
from param.parameterized import ParameterizedMetaclass, Watcher

from .io.document import unlocked
Expand All @@ -36,6 +39,7 @@

if TYPE_CHECKING:
import pandas as pd

from bokeh.document import Document
from bokeh.events import Event
from bokeh.model import Model
Expand Down
11 changes: 5 additions & 6 deletions panel/widgets/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import param

from bokeh.events import ButtonClick, MenuItemClick
from bokeh.models import Button as _BkButton
from bokeh.models import Dropdown as _BkDropdown
from bokeh.models import Toggle as _BkToggle
from panel.links import Callback
from bokeh.models import (
Button as _BkButton, Dropdown as _BkDropdown, Toggle as _BkToggle
)

from ..links import Callback
from .base import Widget

if TYPE_CHECKING:
Expand Down Expand Up @@ -92,7 +92,6 @@ def jscallback(self, args: Dict[str, Any] = {}, **callbacks: str) -> Callback:
callback: Callback
The Callback which can be used to disable the callback.
"""
from ..links import Callback
for k, v in list(callbacks.items()):
if k == 'clicks':
k = 'event:'+self._event
Expand Down Expand Up @@ -170,7 +169,7 @@ def jslink(
The Link can be used unlink the widget and the target model.
"""
links = {'event:'+self._event if p == 'value' else p: v for p, v in links.items()}
super().jslink(target, code, args, bidirectional, **links)
return super().jslink(target, code, args, bidirectional, **links)

def _process_event(self, event: param.parameterized.Event) -> None:
self.param.trigger('value')
Expand Down

0 comments on commit da70943

Please sign in to comment.