9
9
from .widget_style import Style
10
10
from .widget_core import CoreWidget
11
11
from .domwidget import DOMWidget
12
+ import warnings
12
13
13
14
@register
14
15
class DescriptionStyle (Style , CoreWidget , Widget ):
@@ -24,6 +25,13 @@ class DescriptionWidget(DOMWidget, CoreWidget):
24
25
description_allow_html = Bool (False , help = "Accept HTML in the description." ).tag (sync = True )
25
26
style = InstanceDict (DescriptionStyle , help = "Styling customizations" ).tag (sync = True , ** widget_serialization )
26
27
28
+ def __init__ (self , * args , ** kwargs ):
29
+ if 'description_tooltip' in kwargs :
30
+ warnings .warn ("the description_tooltip argument is deprecated, use tooltip instead" , DeprecationWarning )
31
+ kwargs .setdefault ('tooltip' , kwargs ['description_tooltip' ])
32
+ del kwargs ['description_tooltip' ]
33
+ super ().__init__ (* args , ** kwargs )
34
+
27
35
def _repr_keys (self ):
28
36
for key in super ()._repr_keys ():
29
37
# Exclude style if it had the default value
@@ -32,3 +40,17 @@ def _repr_keys(self):
32
40
if repr (value ) == '%s()' % value .__class__ .__name__ :
33
41
continue
34
42
yield key
43
+
44
+ @property
45
+ def description_tooltip (self ):
46
+ """The tooltip information.
47
+ .. deprecated :: 8.0.0
48
+ Use tooltip attribute instead.
49
+ """
50
+ warnings .warn (".description_tooltip is deprecated, use .tooltip instead" , DeprecationWarning )
51
+ return self .tooltip
52
+
53
+ @description_tooltip .setter
54
+ def description_tooltip (self , tooltip ):
55
+ warnings .warn (".description_tooltip is deprecated, use .tooltip instead" , DeprecationWarning )
56
+ self .tooltip = tooltip
0 commit comments