Skip to content

Commit 8fdf020

Browse files
committed
privatize widget_types registry
1 parent 0558166 commit 8fdf020

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ipywidgets/widgets/widget.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def items(self):
247247
def register(widget):
248248
"""A decorator registering a widget class in the widget registry."""
249249
w = widget.class_traits()
250-
Widget.widget_types.register(w['_model_module'].default_value,
250+
Widget._widget_types.register(w['_model_module'].default_value,
251251
w['_model_module_version'].default_value,
252252
w['_model_name'].default_value,
253253
w['_view_module'].default_value,
@@ -266,8 +266,8 @@ class Widget(LoggingHasTraits):
266266
# _active_widgets is a dictionary of all active widget objects
267267
_active_widgets = {}
268268

269-
# widget_types is a registry of widgets by module, version, and name:
270-
widget_types = WidgetRegistry()
269+
# _widget_types is a registry of widgets by module, version, and name:
270+
_widget_types = WidgetRegistry()
271271

272272
@classmethod
273273
def close_all(cls):
@@ -299,7 +299,7 @@ def handle_comm_opened(comm, msg):
299299
state = data['state']
300300

301301
# Find the widget class to instantiate in the registered widgets
302-
widget_class = Widget.widget_types.get(state['_model_module'],
302+
widget_class = Widget._widget_types.get(state['_model_module'],
303303
state['_model_module_version'],
304304
state['_model_name'],
305305
state['_view_module'],

packages/schema/generate-spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def create_markdown(spec):
199199
args = parser.parse_args()
200200
format = args.format
201201

202-
widgets_to_document = sorted(widgets.Widget.widget_types.items())
202+
widgets_to_document = sorted(widgets.Widget._widget_types.items())
203203
spec = create_spec(widgets_to_document)
204204
if format == 'json':
205205
print(json.dumps(spec, sort_keys=True))

0 commit comments

Comments
 (0)