From a1a56f8ee38c338f93c10c9e7f7ce0f00cff18a0 2014-01-29 23:41:20 From: Thomas Kluyver Date: 2014-01-29 23:41:20 Subject: [PATCH] Merge pull request #4927 from minrk/no-files-prefix there shouldn't be a 'files/' prefix in FileLink[s] --- diff --git a/IPython/lib/display.py b/IPython/lib/display.py index 77be24e..22d4f63 100644 --- a/IPython/lib/display.py +++ b/IPython/lib/display.py @@ -267,7 +267,7 @@ class FileLink(object): def __init__(self, path, - url_prefix='files/', + url_prefix='', result_html_prefix='', result_html_suffix='
'): """ @@ -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='
', diff --git a/IPython/lib/tests/test_display.py b/IPython/lib/tests/test_display.py index 9a7e2ff..3223482 100644 --- a/IPython/lib/tests/test_display.py +++ b/IPython/lib/tests/test_display.py @@ -47,7 +47,7 @@ def test_existing_path_FileLink(): tf = NamedTemporaryFile() fl = display.FileLink(tf.name) actual = fl._repr_html_() - expected = "%s
" % (tf.name,tf.name) + expected = "%s
" % (tf.name,tf.name) nt.assert_equal(actual,expected) def test_existing_path_FileLink_repr(): @@ -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/
" % td, - "  %s
" %\ + "  %s
" %\ (tf2.name.replace("\\","/"),split(tf2.name)[1]), - "  %s
" %\ + "  %s
" %\ (tf1.name.replace("\\","/"),split(tf1.name)[1])] expected.sort() # We compare the sorted list of links here as that's more reliable