Permalink
Browse files

Issue #107: Added support for plugin paths relative to site.

  • Loading branch information...
lakshmivyas committed Feb 20, 2012
1 parent ea88729 commit 7451edd83caf5882259cc84d1ba76dc39863d26e
Showing with 17 additions and 7 deletions.
  1. +5 −0 CHANGELOG.rst
  2. +1 −1 README.rst
  3. +1 −1 hyde/plugin.py
  4. +9 −4 hyde/util.py
  5. +1 −1 hyde/version.py
View
@@ -1,3 +1,8 @@
+Version 0.8.5a14
+============================================================
+
+* Bug Fix: Added support for plugin paths relative to site. (Issue #107)
+
Version 0.8.5a13
============================================================
View
@@ -1,4 +1,4 @@
-Version 0.8.5a13
+Version 0.8.5a14
A brand new **hyde**
====================
View
@@ -326,7 +326,7 @@ def app(self):
# Honour the PATH environment variable.
if app_path is not None and not os.path.isabs(app_path):
- app_path = discover_executable(app_path)
+ app_path = discover_executable(app_path, self.site.sitepath)
if app_path is None:
raise self.template.exception_class(
View
@@ -124,12 +124,17 @@ def first_match(predicate, iterable):
return item
return None
-def discover_executable(name):
+def discover_executable(name, sitepath):
"""
- Finds an executable in the path list provided by the PATH
- environment variable.
+ Finds an executable in the given sitepath or in the
+ path list provided by the PATH environment variable.
"""
- for path in os.environ['PATH'].split(os.pathsep):
+
+ # Check if an executable can be found in the site path first.
+ # If not check the os $PATH for its presence.
+
+ paths = [unicode(sitepath)] + os.environ['PATH'].split(os.pathsep)
+ for path in paths:
full_name = os.path.join(path, name)
if os.path.exists(full_name):
return full_name
View
@@ -3,4 +3,4 @@
Handles hyde version
TODO: Use fabric like versioning scheme
"""
-__version__ = '0.8.5a13'
+__version__ = '0.8.5a14'

0 comments on commit 7451edd

Please sign in to comment.