##// END OF EJS Templates
Removed hook for displayout widgets
Removed hook for displayout widgets

File last commit:

r14231:dc861793
r14247:b24ae90d
Show More
javascript.py
28 lines | 1.0 KiB | text/x-python | PythonLexer
"""Utilities to manipulate Javascript files.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.txt, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import glob
import os
from IPython.display import display, Javascript
#-----------------------------------------------------------------------------
# Methods
#-----------------------------------------------------------------------------
def display_all_js(directory):
# Display each javascript file in the directory.
for filename in glob.glob(os.path.join(directory, '*.js')):
with open(filename, 'r') as f:
display(Javascript(data=f.read()))