Skip to content

Commit

Permalink
Moustaches Fixed (#145)
Browse files Browse the repository at this point in the history
* Fixed moustaches failing to load

Used a slightly different function to get the module spec

* Fixing Staches

Update to allow compatibility with different os.
  • Loading branch information
DavidAmison authored and natfarleydev committed Jun 13, 2017
1 parent 0634299 commit a836ad4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ def load_stache(stache_name, possible_dirs):
path = Path(dir_).resolve()
python_path = path.parent
with PythonPathContext(str(python_path)):
module_spec = importlib.util.find_spec(
"{}.{}".format(str(find_last_child(path)), stache_name))
stache_path = find_last_child(path) / stache_name
stache_module = "{}.{}".format(str(find_last_child(path)), stache_name)
module_spec = importlib.util.spec_from_file_location(
stache_module,
"{}.py".format(stache_path))

if module_spec:
foo = importlib.util.module_from_spec(module_spec)
Expand Down Expand Up @@ -116,6 +119,7 @@ def main():
else:
beards_to_load = pyconfig.get('beards')


for stache in pyconfig.get('staches'):
load_stache(stache, pyconfig.get('stache_paths'))

Expand Down

0 comments on commit a836ad4

Please sign in to comment.