##// END OF EJS Templates
Add container widget
Add container widget

File last commit:

r14231:dc861793
r14239:a11ee899
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()))