Renamed widget python classes to avoid name stomping

Jonathan Frederic 13 years ago
parent f3a3e7c9cb
commit 65a6000919

@ -1,10 +1,10 @@
from base import Widget, init_widget_js
from widget import Widget, init_widget_js
from bool import BoolWidget
from container import ContainerWidget
from float import FloatWidget
from float_range import FloatRangeWidget
from int import IntWidget
from int_range import IntRangeWidget
from selection import SelectionWidget
from string import StringWidget
from widget_bool import BoolWidget
from widget_container import ContainerWidget
from widget_float import FloatWidget
from widget_float_range import FloatRangeWidget
from widget_int import IntWidget
from widget_int_range import IntRangeWidget
from widget_selection import SelectionWidget
from widget_string import StringWidget

@ -16,8 +16,9 @@ def init_widget_js():
for filepath in glob(os.path.join(path, "*.py")):
filename = os.path.split(filepath)[1]
name = filename.rsplit('.', 1)[0]
if not (name == 'base' or name == '__init__'):
js_path = 'static/notebook/js/widgets/%s.js' % name
if not (name == 'widget' or name == '__init__') and name.startswith('widget_'):
# Remove 'widget_' from the start of the name before compiling the path.
js_path = 'static/notebook/js/widgets/%s.js' % name[7:]
display(Javascript(data='$.getScript("%s");' % js_path))
Loading…
Cancel
Save