From c73933fe9080c9ae028335cd11720f3ecb4ec520 Mon Sep 17 00:00:00 2001 From: Jason Grout Date: Sat, 13 Dec 2014 00:09:43 +0000 Subject: [PATCH] Make the widget warning easier to catch by specifying the module. --- IPython/html/widgets/__init__.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/IPython/html/widgets/__init__.py b/IPython/html/widgets/__init__.py index 138fdb480..cb474206b 100644 --- a/IPython/html/widgets/__init__.py +++ b/IPython/html/widgets/__init__.py @@ -24,9 +24,15 @@ from .widget_selection import RadioButtonsWidget, ToggleButtonsWidget, DropdownW from .widget_selectioncontainer import TabWidget, AccordionWidget from .widget_string import HTMLWidget, LatexWidget, TextWidget, TextareaWidget -# we use warn_explicit so we have very brief messages without file or line numbers -# the concern is that file or line numbers will confuse the interactive user +# We use warn_explicit so we have very brief messages without file or line numbers. +# The concern is that file or line numbers will confuse the interactive user. +# To ignore this warning, do: +# +# from warnings import filterwarnings +# filterwarnings('ignore', module='IPython.html.widgets') + from warnings import warn_explicit __warningregistry__ = {} warn_explicit("IPython widgets are experimental and may change in the future.", - FutureWarning, '', 0, registry=__warningregistry__) + FutureWarning, '', 0, module = 'IPython.html.widgets', + registry = __warningregistry__, module_globals = globals)