Browse Source

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

main
Lakshmi Vyasarajan 13 years ago
parent
commit
7451edd83c
5 changed files 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

+ 5
- 0
CHANGELOG.rst View File

@@ -1,3 +1,8 @@
Version 0.8.5a14
============================================================

* Bug Fix: Added support for plugin paths relative to site. (Issue #107)

Version 0.8.5a13 Version 0.8.5a13
============================================================ ============================================================




+ 1
- 1
README.rst View File

@@ -1,4 +1,4 @@
Version 0.8.5a13
Version 0.8.5a14


A brand new **hyde** A brand new **hyde**
==================== ====================


+ 1
- 1
hyde/plugin.py View File

@@ -326,7 +326,7 @@ class CLTransformer(Plugin):


# Honour the PATH environment variable. # Honour the PATH environment variable.
if app_path is not None and not os.path.isabs(app_path): 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: if app_path is None:
raise self.template.exception_class( raise self.template.exception_class(


+ 9
- 4
hyde/util.py View File

@@ -124,12 +124,17 @@ def first_match(predicate, iterable):
return item return item
return None 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) full_name = os.path.join(path, name)
if os.path.exists(full_name): if os.path.exists(full_name):
return full_name return full_name

+ 1
- 1
hyde/version.py View File

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

Loading…
Cancel
Save