def load_ipython_extension(ipython): if IPython.version_info[0] >= 5: warnings.warn( "Loading the nengo.ipynb notebook extension is no longer " "required. Progress bars are automatically activated for IPython " "version 5 and later.") elif has_ipynb_widgets() and rc.get('progress', 'progress_bar') == 'auto': warnings.warn( "The nengo.ipynb notebook extension is deprecated. Please upgrade " "to IPython version 5 or later.") IPythonProgressWidget.load_frontend(ipython) rc.set('progress', 'progress_bar', '.'.join( (__name__, IPython2ProgressBar.__name__)))
def load_ipython_extension(ipython): if IPython.version_info[0] >= 5: warnings.warn( "Loading the nengo.ipynb notebook extension is no longer " "required. Progress bars are automatically activated for IPython " "version 5 and later.") elif has_ipynb_widgets() and rc.get('progress', 'progress_bar') == 'auto': warnings.warn( "The nengo.ipynb notebook extension is deprecated. Please upgrade " "to IPython version 5 or later.") IPythonProgressWidget.load_frontend(ipython) rc.set('progress', 'progress_bar', '.'.join(( __name__, IPython2ProgressBar.__name__)))
def load_ipython_extension(ipython): if has_ipynb_widgets() and rc.get('progress', 'progress_bar') == 'auto': IPythonProgressWidget.load_frontend(ipython) rc.set('progress', 'progress_bar', '.'.join( (__name__, IPython2ProgressBar.__name__)))
At the moment this only activates the improved progress bar. Use ``%load_ext nengo.ipynb`` in an IPython notebook to load the extension. Note ---- This IPython extension cannot be unloaded. """ from nengo.rc import rc from nengo.utils.ipython import has_ipynb_widgets from nengo.utils.progress import ProgressBar, timestamp2timedelta if has_ipynb_widgets(): import IPython if IPython.version_info[0] <= 3: from IPython.html.widgets import DOMWidget import IPython.utils.traitlets as traitlets else: from ipywidgets import DOMWidget import traitlets from IPython.display import display else: DOMWidget = object def load_ipython_extension(ipython): if has_ipynb_widgets() and rc.get('progress', 'progress_bar') == 'auto': IPythonProgressWidget.load_frontend(ipython)
def load_ipython_extension(ipython): if has_ipynb_widgets() and rc.get('progress', 'progress_bar') == 'auto': IPythonProgressWidget.load_frontend(ipython) rc.set('progress', 'progress_bar', '.'.join(( __name__, IPython2ProgressBar.__name__)))
""" try: from html import escape except ImportError: from cgi import escape as cgi_escape escape = lambda s, quote=True: cgi_escape(s, quote=quote) import warnings import IPython from nengo.rc import rc from nengo.utils.ipython import has_ipynb_widgets from nengo.utils.progress import ProgressBar, timestamp2timedelta if has_ipynb_widgets(): if IPython.version_info[0] <= 3: from IPython.html.widgets import DOMWidget import IPython.utils.traitlets as traitlets else: import ipywidgets from ipywidgets import DOMWidget import traitlets from IPython.display import display else: raise ImportError( "Required dependency could not be loaded. Please install ipywidgets.") try: import notebook