From a43583b1faaf71e3e4d8bb65adbf0b8d19483b9a Mon Sep 17 00:00:00 2001 From: Lakshmi Vyasarajan Date: Sun, 19 Jun 2011 14:15:55 +0530 Subject: [PATCH] Issue #51: Fixed site.full_url for media paths --- hyde/site.py | 6 +++--- hyde/tests/test_site.py | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hyde/site.py b/hyde/site.py index e3a0fd3..dc10b36 100644 --- a/hyde/site.py +++ b/hyde/site.py @@ -402,9 +402,9 @@ class Site(object): if urlparse.urlparse(path)[:2] != ("",""): return path if self.is_media(path): - return self.media_url( - FS(path).get_relative_path( - self.config.media_root_path)) + relative_path = File(path).get_relative_path( + Folder(self.config.media_root)) + return self.media_url(relative_path) else: return self.content_url(path) diff --git a/hyde/tests/test_site.py b/hyde/tests/test_site.py index 947aa3e..a64b7b9 100644 --- a/hyde/tests/test_site.py +++ b/hyde/tests/test_site.py @@ -223,8 +223,6 @@ class TestSiteWithConfig(object): path = 'media/css/site.css' assert s.is_media(path) full_url = s.full_url(path) - print s.config.media_root_path - print File(path).get_relative_path(s.config.media_root_path) assert full_url == "/" + path def test_media_url_from_resource(self):