From 288b8a0ced587138fb39f306c5b00a752a81f751 Mon Sep 17 00:00:00 2001 From: Jonathan Frederic Date: Wed, 22 Jan 2014 16:21:00 -0800 Subject: [PATCH] s/view_name/_view_name --- IPython/html/static/notebook/js/widgetmanager.js | 2 +- IPython/html/widgets/widget.py | 2 +- IPython/html/widgets/widget_bool.py | 4 ++-- IPython/html/widgets/widget_button.py | 2 +- IPython/html/widgets/widget_container.py | 4 ++-- IPython/html/widgets/widget_float.py | 8 ++++---- IPython/html/widgets/widget_image.py | 2 +- IPython/html/widgets/widget_int.py | 8 ++++---- IPython/html/widgets/widget_selection.py | 8 ++++---- IPython/html/widgets/widget_selectioncontainer.py | 4 ++-- IPython/html/widgets/widget_string.py | 8 ++++---- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/IPython/html/static/notebook/js/widgetmanager.js b/IPython/html/static/notebook/js/widgetmanager.js index ca1b9f71f..3625b1353 100644 --- a/IPython/html/static/notebook/js/widgetmanager.js +++ b/IPython/html/static/notebook/js/widgetmanager.js @@ -91,7 +91,7 @@ }, WidgetManager.prototype.create_view = function(model, options, view) { - var view_name = model.get('view_name'); + var view_name = model.get('_view_name'); var ViewType = WidgetManager._view_types[view_name]; if (ViewType !== undefined && ViewType !== null) { diff --git a/IPython/html/widgets/widget.py b/IPython/html/widgets/widget.py index 151e0cf22..05b3ac3f2 100644 --- a/IPython/html/widgets/widget.py +++ b/IPython/html/widgets/widget.py @@ -119,7 +119,7 @@ class Widget(LoggingConfigurable): #------------------------------------------------------------------------- model_name = Unicode('WidgetModel', help="""Name of the backbone model registered in the front-end to create and sync this widget with.""") - view_name = Unicode(help="""Default view registered in the front-end + _view_name = Unicode(help="""Default view registered in the front-end to use to represent the widget.""", sync=True) _comm = Instance('IPython.kernel.comm.Comm') diff --git a/IPython/html/widgets/widget_bool.py b/IPython/html/widgets/widget_bool.py index 6cebbca7c..91b3f903f 100644 --- a/IPython/html/widgets/widget_bool.py +++ b/IPython/html/widgets/widget_bool.py @@ -26,9 +26,9 @@ class _BoolWidget(DOMWidget): class CheckBoxWidget(_BoolWidget): - view_name = Unicode('CheckBoxView', sync=True) + _view_name = Unicode('CheckBoxView', sync=True) class ToggleButtonWidget(_BoolWidget): - view_name = Unicode('ToggleButtonView', sync=True) + _view_name = Unicode('ToggleButtonView', sync=True) \ No newline at end of file diff --git a/IPython/html/widgets/widget_button.py b/IPython/html/widgets/widget_button.py index cedc1f84d..c2f552e4c 100644 --- a/IPython/html/widgets/widget_button.py +++ b/IPython/html/widgets/widget_button.py @@ -21,7 +21,7 @@ from IPython.utils.traitlets import Unicode, Bool # Classes #----------------------------------------------------------------------------- class ButtonWidget(DOMWidget): - view_name = Unicode('ButtonView', sync=True) + _view_name = Unicode('ButtonView', sync=True) # Keys description = Unicode('', help="Description of the button (label).", sync=True) diff --git a/IPython/html/widgets/widget_container.py b/IPython/html/widgets/widget_container.py index e02b24b9b..82d4ae264 100644 --- a/IPython/html/widgets/widget_container.py +++ b/IPython/html/widgets/widget_container.py @@ -20,7 +20,7 @@ from IPython.utils.traitlets import Unicode, Bool, List, Instance # Classes #----------------------------------------------------------------------------- class ContainerWidget(DOMWidget): - view_name = Unicode('ContainerView', sync=True) + _view_name = Unicode('ContainerView', sync=True) # Keys, all private and managed by helper methods. Flexible box model # classes... @@ -50,7 +50,7 @@ class ContainerWidget(DOMWidget): class PopupWidget(ContainerWidget): - view_name = Unicode('PopupView', sync=True) + _view_name = Unicode('PopupView', sync=True) description = Unicode(sync=True) button_text = Unicode(sync=True) diff --git a/IPython/html/widgets/widget_float.py b/IPython/html/widgets/widget_float.py index 18176f0d3..51323316c 100644 --- a/IPython/html/widgets/widget_float.py +++ b/IPython/html/widgets/widget_float.py @@ -42,18 +42,18 @@ class _BoundedFloatWidget(_FloatWidget): class FloatTextWidget(_FloatWidget): - view_name = Unicode('FloatTextView', sync=True) + _view_name = Unicode('FloatTextView', sync=True) class BoundedFloatTextWidget(_BoundedFloatWidget): - view_name = Unicode('FloatTextView', sync=True) + _view_name = Unicode('FloatTextView', sync=True) class FloatSliderWidget(_BoundedFloatWidget): - view_name = Unicode('FloatSliderView', sync=True) + _view_name = Unicode('FloatSliderView', sync=True) orientation = Enum([u'horizontal', u'vertical'], u'horizontal', help="Vertical or horizontal.", sync=True) class FloatProgressWidget(_BoundedFloatWidget): - view_name = Unicode('ProgressView', sync=True) + _view_name = Unicode('ProgressView', sync=True) diff --git a/IPython/html/widgets/widget_image.py b/IPython/html/widgets/widget_image.py index 139b9db07..0621ed427 100644 --- a/IPython/html/widgets/widget_image.py +++ b/IPython/html/widgets/widget_image.py @@ -23,7 +23,7 @@ from IPython.utils.traitlets import Unicode, CUnicode, Bytes # Classes #----------------------------------------------------------------------------- class ImageWidget(DOMWidget): - view_name = Unicode('ImageView', sync=True) + _view_name = Unicode('ImageView', sync=True) # Define the custom state properties to sync with the front-end format = Unicode('png', sync=True) diff --git a/IPython/html/widgets/widget_int.py b/IPython/html/widgets/widget_int.py index a5ce31de8..97c2e0e9f 100644 --- a/IPython/html/widgets/widget_int.py +++ b/IPython/html/widgets/widget_int.py @@ -42,18 +42,18 @@ class _BoundedIntWidget(_IntWidget): class IntTextWidget(_IntWidget): - view_name = Unicode('IntTextView', sync=True) + _view_name = Unicode('IntTextView', sync=True) class BoundedIntTextWidget(_BoundedIntWidget): - view_name = Unicode('IntTextView', sync=True) + _view_name = Unicode('IntTextView', sync=True) class IntSliderWidget(_BoundedIntWidget): - view_name = Unicode('IntSliderView', sync=True) + _view_name = Unicode('IntSliderView', sync=True) orientation = Enum([u'horizontal', u'vertical'], u'horizontal', help="Vertical or horizontal.", sync=True) class IntProgressWidget(_BoundedIntWidget): - view_name = Unicode('ProgressView', sync=True) + _view_name = Unicode('ProgressView', sync=True) diff --git a/IPython/html/widgets/widget_selection.py b/IPython/html/widgets/widget_selection.py index eac867eaf..bb54c613f 100644 --- a/IPython/html/widgets/widget_selection.py +++ b/IPython/html/widgets/widget_selection.py @@ -85,16 +85,16 @@ class _SelectionWidget(DOMWidget): class ToggleButtonsWidget(_SelectionWidget): - view_name = Unicode('ToggleButtonsView', sync=True) + _view_name = Unicode('ToggleButtonsView', sync=True) class DropdownWidget(_SelectionWidget): - view_name = Unicode('DropdownView', sync=True) + _view_name = Unicode('DropdownView', sync=True) class RadioButtonsWidget(_SelectionWidget): - view_name = Unicode('RadioButtonsView', sync=True) + _view_name = Unicode('RadioButtonsView', sync=True) class ListBoxWidget(_SelectionWidget): - view_name = Unicode('ListBoxView', sync=True) + _view_name = Unicode('ListBoxView', sync=True) diff --git a/IPython/html/widgets/widget_selectioncontainer.py b/IPython/html/widgets/widget_selectioncontainer.py index f27b5236c..0f9156ab8 100644 --- a/IPython/html/widgets/widget_selectioncontainer.py +++ b/IPython/html/widgets/widget_selectioncontainer.py @@ -51,8 +51,8 @@ class _SelectionContainerWidget(ContainerWidget): class AccordionWidget(_SelectionContainerWidget): - view_name = Unicode('AccordionView', sync=True) + _view_name = Unicode('AccordionView', sync=True) class TabWidget(_SelectionContainerWidget): - view_name = Unicode('TabView', sync=True) + _view_name = Unicode('TabView', sync=True) diff --git a/IPython/html/widgets/widget_string.py b/IPython/html/widgets/widget_string.py index 72539d336..52020b6a1 100644 --- a/IPython/html/widgets/widget_string.py +++ b/IPython/html/widgets/widget_string.py @@ -26,22 +26,22 @@ class _StringWidget(DOMWidget): class HTMLWidget(_StringWidget): - view_name = Unicode('HTMLView', sync=True) + _view_name = Unicode('HTMLView', sync=True) class LatexWidget(_StringWidget): - view_name = Unicode('LatexView', sync=True) + _view_name = Unicode('LatexView', sync=True) class TextAreaWidget(_StringWidget): - view_name = Unicode('TextAreaView', sync=True) + _view_name = Unicode('TextAreaView', sync=True) def scroll_to_bottom(self): self.send({"method": "scroll_to_bottom"}) class TextBoxWidget(_StringWidget): - view_name = Unicode('TextBoxView', sync=True) + _view_name = Unicode('TextBoxView', sync=True) def __init__(self, **kwargs): super(TextBoxWidget, self).__init__(**kwargs)