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