Mercurial > kallithea
comparison rhodecode/controllers/files.py @ 1200:3ecaa17d9dea beta
added os.sep for files controller
updated changelog
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 02 Apr 2011 21:29:50 +0200 |
parents | 0d7a127e6449 |
children | 6832ef664673 |
comparison
equal
deleted
inserted
replaced
1199:268fa0b6b2ef | 1200:3ecaa17d9dea |
---|---|
23 # You should have received a copy of the GNU General Public License | 23 # You should have received a copy of the GNU General Public License |
24 # along with this program; if not, write to the Free Software | 24 # along with this program; if not, write to the Free Software |
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | 25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
26 # MA 02110-1301, USA. | 26 # MA 02110-1301, USA. |
27 | 27 |
28 import os | |
28 import logging | 29 import logging |
29 import rhodecode.lib.helpers as h | 30 import rhodecode.lib.helpers as h |
30 | 31 |
31 from pylons import request, response, session, tmpl_context as c, url | 32 from pylons import request, response, session, tmpl_context as c, url |
32 from pylons.i18n.translation import _ | 33 from pylons.i18n.translation import _ |
151 def rawfile(self, repo_name, revision, f_path): | 152 def rawfile(self, repo_name, revision, f_path): |
152 cs = self.__get_cs_or_redirect(revision, repo_name) | 153 cs = self.__get_cs_or_redirect(revision, repo_name) |
153 file_node = self.__get_filenode_or_redirect(repo_name, cs, f_path) | 154 file_node = self.__get_filenode_or_redirect(repo_name, cs, f_path) |
154 | 155 |
155 response.content_disposition = 'attachment; filename=%s' % \ | 156 response.content_disposition = 'attachment; filename=%s' % \ |
156 f_path.split('/')[-1].encode('utf8', 'replace') | 157 f_path.split(os.sep)[-1].encode('utf8', 'replace') |
157 | 158 |
158 response.content_type = file_node.mimetype | 159 response.content_type = file_node.mimetype |
159 return file_node.content | 160 return file_node.content |
160 | 161 |
161 def raw(self, repo_name, revision, f_path): | 162 def raw(self, repo_name, revision, f_path): |