Commits

Lakshmi Vyasarajan  committed 15ec1bf

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

  • Participants
  • Parent commits 310ee94

Comments (0)

Files changed (5)

File CHANGELOG.rst

+Version 0.8.5a14
+============================================================
+
+*   Bug Fix: Added support for plugin paths relative to site. (Issue #107)
+
 Version 0.8.5a13
 ============================================================
 
-Version 0.8.5a13
+Version 0.8.5a14
 
 A brand new **hyde**
 ====================

File hyde/plugin.py

 
         # 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(

File hyde/util.py

             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

File hyde/version.py

 Handles hyde version
 TODO: Use fabric like versioning scheme
 """
-__version__ = '0.8.5a13'
+__version__ = '0.8.5a14'