Skip to content

Commit

Permalink
Merge pull request ipython#4868 from juliantaylor/static-path-fixes
Browse files Browse the repository at this point in the history
Static path fixes
  • Loading branch information
minrk committed Jan 25, 2014
2 parents d70bc72 + 3628626 commit fa752f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion IPython/core/tests/test_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ def test_image_filename_defaults():
nt.assert_raises(ValueError, display.Image)
nt.assert_raises(ValueError, display.Image, data='this is not an image', format='badformat', embed=True)
from IPython.html import DEFAULT_STATIC_FILES_PATH
imgfile = os.path.join(DEFAULT_STATIC_FILES_PATH, 'base/images/ipynblogo.png')
# check boths paths to allow packages to test at build and install time
imgfile = os.path.join(tpath, 'html/static/base/images/ipynblogo.png')
if not os.path.exists(imgfile):
imgfile = os.path.join(DEFAULT_STATIC_FILES_PATH, 'base/images/ipynblogo.png')
img = display.Image(filename=imgfile)
nt.assert_equal('png', img.format)
nt.assert_is_not_none(img._repr_png_())
Expand Down
5 changes: 3 additions & 2 deletions IPython/nbconvert/preprocessors/csshtmlheader.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ def _regen_header(self):
header = []

#Construct path to IPy CSS
sheet_filename = os.path.join(path.get_ipython_package_dir(),
'html', 'static', 'style', 'style.min.css')
from IPython.html import DEFAULT_STATIC_FILES_PATH
sheet_filename = os.path.join(DEFAULT_STATIC_FILES_PATH,
'style', 'style.min.css')

#Load style CSS file.
with io.open(sheet_filename, encoding='utf-8') as file:
Expand Down

0 comments on commit fa752f7

Please sign in to comment.