Skip to content

Commit

Permalink
Properly close js and css files after opening
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Jan 27, 2017
1 parent 13702cc commit 9d1e390
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions holoviews/plotting/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,15 @@ def html_assets(cls, core=True, extras=True, backends=None):

# Join all the js widget code into one string
path = os.path.dirname(os.path.abspath(__file__))
widgetjs = '\n'.join(open(find_file(path, f), 'r').read()
for f in basejs + extensionjs
if f is not None )
widgetcss = '\n'.join(open(find_file(path, f), 'r').read()

def open_and_read(path, f):
with open(find_file(path, f), 'r') as f:
txt = f.read()
return txt

widgetjs = '\n'.join(open_and_read(path, f)
for f in basejs + extensionjs if f is not None)
widgetcss = '\n'.join(open_and_read(path, f)
for f in css if f is not None)

dependencies = {}
Expand Down

0 comments on commit 9d1e390

Please sign in to comment.