Did I find the right examples for you? yes no

All Samples(8)  |  Call(6)  |  Derive(0)  |  Import(2)
Check whether nbextension files have been installed

files should be a list of relative paths within nbextensions.

Returns True if all files are found, False if any are missing.

        def check_nbextension(files, ipython_dir=None):
    """Check whether nbextension files have been installed
    
    files should be a list of relative paths within nbextensions.
    
    Returns True if all files are found, False if any are missing.
    """
    ipython_dir = ipython_dir or get_ipython_dir()
    nbext = pjoin(ipython_dir, u'nbextensions')
    # make sure nbextensions dir exists
    if not os.path.exists(nbext):
        return False
    
    if isinstance(files, string_types):
        # one file given, turn it into a list
        files = [files]
    
    return all(os.path.exists(pjoin(nbext, f)) for f in files)
        


src/i/p/ipython-2.0.0/IPython/html/tests/test_nbextensions.py   ipython(Download)
from IPython.utils.tempdir import TemporaryDirectory
from IPython.html import nbextensions
from IPython.html.nbextensions import install_nbextension, check_nbextension
 
#-----------------------------------------------------------------------------
            install_nbextension(src)
 
        assert check_nbextension(f, self.ipdir)
        assert check_nbextension([f], self.ipdir)
        assert not check_nbextension([f, pjoin('dne', f)], self.ipdir)

src/i/p/ipython-HEAD/IPython/html/tests/test_nbextensions.py   ipython(Download)
from IPython.utils.tempdir import TemporaryDirectory
from IPython.html import nbextensions
from IPython.html.nbextensions import install_nbextension, check_nbextension
 
#-----------------------------------------------------------------------------
            install_nbextension(src)
 
        assert check_nbextension(f, self.ipdir)
        assert check_nbextension([f], self.ipdir)
        assert not check_nbextension([f, pjoin('dne', f)], self.ipdir)