##// END OF EJS Templates
Added utility function to send all the javascript...
Jonathan Frederic -
Show More
@@ -0,0 +1,28
1 """Utilities to manipulate Javascript files.
2 """
3 #-----------------------------------------------------------------------------
4 # Copyright (C) 2013 The IPython Development Team
5 #
6 # Distributed under the terms of the BSD License. The full license is in
7 # the file COPYING.txt, distributed as part of this software.
8 #-----------------------------------------------------------------------------
9
10 #-----------------------------------------------------------------------------
11 # Imports
12 #-----------------------------------------------------------------------------
13
14 import glob
15 import os
16
17 from IPython.display import display, Javascript
18
19 #-----------------------------------------------------------------------------
20 # Methods
21 #-----------------------------------------------------------------------------
22
23 def display_all_js(directory):
24
25 # Display each javascript file in the directory.
26 for filename in glob.glob(os.path.join(directory, '*.js')):
27 with open(filename, 'r') as f:
28 display(Javascript(data=f.read()))
General Comments 0
You need to be logged in to leave comments. Login now