Show More
@@ -37,19 +37,19 b' class YouTubeVideo(object):' | |||
|
37 | 37 | ></iframe> |
|
38 | 38 | """%(self.width, self.height, self.id) |
|
39 | 39 | |
|
40 |
class |
|
|
40 | class FileLink(object): | |
|
41 | 41 | """Class for embedding a local file link in an IPython session, based on path |
|
42 | 42 | |
|
43 | 43 | e.g. to embed a link that was generated in the IPython notebook as my/data.txt |
|
44 | 44 | |
|
45 | 45 | you would do: |
|
46 | 46 | |
|
47 |
local_file = |
|
|
47 | local_file = FileLink("my/data.txt") | |
|
48 | 48 | display(local_file) |
|
49 | 49 | |
|
50 | 50 | or in the HTML notebook, just |
|
51 | 51 | |
|
52 |
|
|
|
52 | FileLink("my/data.txt") | |
|
53 | 53 | """ |
|
54 | 54 | |
|
55 | 55 | def __init__(self, |
@@ -93,21 +93,21 b' class LocalFile(object):' | |||
|
93 | 93 | # Right now this is the same as a formatting for a single file, but |
|
94 | 94 | # we'll encorage users to reference these with a different class in |
|
95 | 95 | # case we want to change this in the future. |
|
96 |
|
|
|
96 | DirectoryLink = FileLink | |
|
97 | 97 | |
|
98 |
class |
|
|
98 | class FileLinks(FileLink): | |
|
99 | 99 | """Class for embedding local file links in an IPython session, based on path |
|
100 | 100 | |
|
101 | 101 | e.g. to embed links to files that were generated in the IPython notebook under my/data |
|
102 | 102 | |
|
103 | 103 | you would do: |
|
104 | 104 | |
|
105 |
local_files = |
|
|
105 | local_files = FileLinks("my/data") | |
|
106 | 106 | display(local_files) |
|
107 | 107 | |
|
108 | 108 | or in the HTML notebook, just |
|
109 | 109 | |
|
110 |
|
|
|
110 | FileLinks("my/data") | |
|
111 | 111 | |
|
112 | 112 | """ |
|
113 | 113 | def __init__(self, |
@@ -120,11 +120,11 b' class LocalFiles(LocalFile):' | |||
|
120 | 120 | included_suffixes : list of filename suffixes to include when |
|
121 | 121 | formatting output [default: include all files] |
|
122 | 122 | |
|
123 |
See the |
|
|
123 | See the FileLink (baseclass of LocalDirectory) docstring for | |
|
124 | 124 | information on additional parameters. |
|
125 | 125 | """ |
|
126 | 126 | self._included_suffixes = _included_suffixes |
|
127 |
|
|
|
127 | FileLink.__init__(self, | |
|
128 | 128 | path, |
|
129 | 129 | _directory_prefix, |
|
130 | 130 | _result_html_prefix, |
General Comments 0
You need to be logged in to leave comments.
Login now