Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Commit

Permalink
Wrap DatePicker import in try/except
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Feb 27, 2017
1 parent 58f0d84 commit 8630cb2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions paramnb/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import ipywidgets
from ipywidgets import (SelectMultiple, Button, HBox, VBox, Layout,
Text, HTML, FloatSlider, FloatText, IntText,
IntSlider, SelectMultiple, Image, DatePicker,
ColorPicker, FloatRangeSlider, IntRangeSlider)
IntSlider, SelectMultiple, Image, ColorPicker,
FloatRangeSlider, IntRangeSlider)
from traitlets import Unicode

from .util import named_objs
Expand Down Expand Up @@ -302,12 +302,14 @@ def apply_error_style(w, error):

# Handle new parameters introduced in param 1.5
try:
from param import Color, Date, Range
from param import Color, Range
ptype2wtype.update({
Color: ColorWidget,
Date: DateWidget,
Range: RangeWidget,
Range: RangeWidget
})

from ipywidgets import DatePicker
ptype2wtype[Date] = DateWidget
except:
pass

Expand Down

0 comments on commit 8630cb2

Please sign in to comment.