Skip to content

Commit

Permalink
there shouldn't be a 'files/' prefix in FileLink[s]
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Jan 29, 2014
1 parent 04ab404 commit 9e167a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions IPython/lib/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class FileLink(object):

def __init__(self,
path,
url_prefix='files/',
url_prefix='',
result_html_prefix='',
result_html_suffix='<br>'):
"""
Expand Down Expand Up @@ -328,7 +328,7 @@ class FileLinks(FileLink):
"""
def __init__(self,
path,
url_prefix='files/',
url_prefix='',
included_suffixes=None,
result_html_prefix='',
result_html_suffix='<br>',
Expand Down
6 changes: 3 additions & 3 deletions IPython/lib/tests/test_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_existing_path_FileLink():
tf = NamedTemporaryFile()
fl = display.FileLink(tf.name)
actual = fl._repr_html_()
expected = "<a href='files/%s' target='_blank'>%s</a><br>" % (tf.name,tf.name)
expected = "<a href='%s' target='_blank'>%s</a><br>" % (tf.name,tf.name)
nt.assert_equal(actual,expected)

def test_existing_path_FileLink_repr():
Expand Down Expand Up @@ -93,9 +93,9 @@ def test_existing_path_FileLinks():
# the links should always have forward slashes, even on windows, so replace
# backslashes with forward slashes here
expected = ["%s/<br>" % td,
"&nbsp;&nbsp;<a href='files/%s' target='_blank'>%s</a><br>" %\
"&nbsp;&nbsp;<a href='%s' target='_blank'>%s</a><br>" %\
(tf2.name.replace("\\","/"),split(tf2.name)[1]),
"&nbsp;&nbsp;<a href='files/%s' target='_blank'>%s</a><br>" %\
"&nbsp;&nbsp;<a href='%s' target='_blank'>%s</a><br>" %\
(tf1.name.replace("\\","/"),split(tf1.name)[1])]
expected.sort()
# We compare the sorted list of links here as that's more reliable
Expand Down

0 comments on commit 9e167a1

Please sign in to comment.