From 6e5276c99c9cde1bfbfd4f03279a7227a0cac3ee Mon Sep 17 00:00:00 2001 From: Lakshmi Vyasarajan Date: Thu, 30 May 2013 15:38:32 +0530 Subject: [PATCH] Fix subfolders for root paths on windows. (Issue #167). - Ensure that subfolders for `layout_root`, `content_root`, `media_root` and `deploy_root` works reliably on windows. Use `fully_expanded_path` for all path components. --- CHANGELOG.rst | 11 ++++++++++- README.rst | 2 +- hyde/model.py | 13 +++++++++---- hyde/version.py | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4dfe25f..a2cec68 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,13 @@ +Version 0.8.7a8 +============================================================ + +* Fix subfolders for root paths on windows. (Issue #167). + + - Using subfolders for `layout_root`, `content_root`, + `media_root` and `deploy_root` now works reliably + on windows. + + Version 0.8.7a7 ============================================================ @@ -5,7 +15,6 @@ Version 0.8.7a7 * Fixed `raise_exceptions` commandline parameter handling. - Version 0.8.7a6 ============================================================ diff --git a/README.rst b/README.rst index fbb4fda..c023ade 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -Version 0.8.7a7 +Version 0.8.7a8 A brand new **hyde** ==================== diff --git a/hyde/model.py b/hyde/model.py index d8b15d0..43d026f 100644 --- a/hyde/model.py +++ b/hyde/model.py @@ -146,6 +146,10 @@ class Dependents(IterableUserDict): if self.deps_file.parent.exists: self.deps_file.write(yaml.dump(self.data)) +def _expand_path(sitepath, path): + child = sitepath.child_folder(path) + return Folder(child.fully_expanded_path) + class Config(Expando): """ Represents the hyde configuration file @@ -226,25 +230,26 @@ class Config(Expando): """ Derives the deploy root path from the site path """ - return self.sitepath.child_folder(self.deploy_root) + return _expand_path(self.sitepath, self.deploy_root) @property def content_root_path(self): """ Derives the content root path from the site path """ - return self.sitepath.child_folder(self.content_root) + return _expand_path(self.sitepath, self.content_root) @property def media_root_path(self): """ Derives the media root path from the content path """ - return self.content_root_path.child_folder(self.media_root) + path = Folder(self.content_root).child(self.media_root) + return _expand_path(self.sitepath, path) @property def layout_root_path(self): """ Derives the layout root path from the site path """ - return self.sitepath.child_folder(self.layout_root) + return _expand_path(self.sitepath, self.layout_root) diff --git a/hyde/version.py b/hyde/version.py index 25a1f50..2d34126 100644 --- a/hyde/version.py +++ b/hyde/version.py @@ -2,4 +2,4 @@ """ Handles hyde version. """ -__version__ = '0.8.7a7' +__version__ = '0.8.7a8'