8000 Make Param._mapping public by philippjfr · Pull Request #3173 · holoviz/panel · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Cleanup
  • Loading branch information
philippjfr committed Feb 3, 2022
commit 826743577100b90ba5d8167c145e56ec48cce865
12 changes: 7 additions & 5 deletions panel/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def widget(self, p_name):
if bounds[1] is not None:
kw['end'] = bounds[1]
if ('start' not in kw or 'end' not in kw):
# Do not change widget class if _mapping was overridden
# Do not change widget class if mapping was overridden
if not widget_class_overridden:
if (isinstance(p_obj, param.Number) and
not isinstance(p_obj, (param.Date, param.CalendarDate))):
Expand Down Expand Up @@ -665,10 +665,12 @@ def applies(cls, obj):
def widget_type(cls, pobj):
ptype = type(pobj)
for t in classlist(ptype)[::-1]:
if t in cls._mapping:
if isinstance(cls._mapping[t], types.FunctionType):
return cls._mapping[t](pobj)
return cls._mapping[t]
if t not in cls.mapping:
continue
wtype = cls.mapping[t]
if isinstance(wtype, types.FunctionType):
return wtype(pobj)
return wtype

def select(self, selector=None):
"""
Expand Down
0