Show More
@@ -54,7 +54,7 b' class FileLink(object):' | |||
|
54 | 54 | |
|
55 | 55 | def __init__(self, |
|
56 | 56 | path, |
|
57 |
|
|
|
57 | url_prefix='files', | |
|
58 | 58 | _result_html_prefix='', |
|
59 | 59 | _result_html_suffix='<br>'): |
|
60 | 60 | """ |
@@ -67,13 +67,13 b' class FileLink(object):' | |||
|
67 | 67 | [default: '<br>'] |
|
68 | 68 | """ |
|
69 | 69 | self.path = path |
|
70 |
self. |
|
|
70 | self.url_prefix = url_prefix | |
|
71 | 71 | self._link_str = "<a href='%s' target='_blank'>%s</a>" |
|
72 | 72 | self._result_html_prefix = _result_html_prefix |
|
73 | 73 | self._result_html_suffix = _result_html_suffix |
|
74 | 74 | |
|
75 | 75 | def _format_path(self): |
|
76 |
fp = join(self. |
|
|
76 | fp = join(self.url_prefix,self.path) | |
|
77 | 77 | return ''.join([self._result_html_prefix, |
|
78 | 78 | self._link_str % (fp, self.path), |
|
79 | 79 | self._result_html_suffix]) |
@@ -112,7 +112,7 b' class FileLinks(FileLink):' | |||
|
112 | 112 | """ |
|
113 | 113 | def __init__(self, |
|
114 | 114 | path, |
|
115 |
|
|
|
115 | url_prefix='files', | |
|
116 | 116 | _included_suffixes=None, |
|
117 | 117 | _result_html_prefix='', |
|
118 | 118 | _result_html_suffix='<br>'): |
@@ -126,7 +126,7 b' class FileLinks(FileLink):' | |||
|
126 | 126 | self._included_suffixes = _included_suffixes |
|
127 | 127 | FileLink.__init__(self, |
|
128 | 128 | path, |
|
129 |
|
|
|
129 | url_prefix, | |
|
130 | 130 | _result_html_prefix, |
|
131 | 131 | _result_html_suffix) |
|
132 | 132 | |
@@ -134,7 +134,7 b' class FileLinks(FileLink):' | |||
|
134 | 134 | result_entries = [] |
|
135 | 135 | for root, dirs, files in walk(self.path): |
|
136 | 136 | for fn in files: |
|
137 |
fp = join(self. |
|
|
137 | fp = join(self.url_prefix,root,fn) | |
|
138 | 138 | # if all files are being included, or fp has a suffix |
|
139 | 139 | # that is in included_suffix, create a link to fp |
|
140 | 140 | if self._included_suffixes == None or \ |
General Comments 0
You need to be logged in to leave comments.
Login now