diff options
author | Antoine Catton <acatton@fusionbox.com> | 2015-07-17 10:44:36 -0600 |
---|---|---|
committer | Antoine Catton <acatton@fusionbox.com> | 2015-07-17 10:44:36 -0600 |
commit | 8baf1e9c78af733d60299c4444c81501e733b434 (patch) | |
tree | 814c2ebf05e891c6496e3dbad92f1eac151544d5 /django_pyscss/extension/django.py | |
parent | a48118f5805b62c3c5fe6ada8340ba1a129e8ce9 (diff) | |
parent | 57d006ba359a9f182a8545fc6ec689e5edca6102 (diff) | |
download | django-pyscss-master.tar.gz |
Diffstat (limited to 'django_pyscss/extension/django.py')
-rw-r--r-- | django_pyscss/extension/django.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/django_pyscss/extension/django.py b/django_pyscss/extension/django.py index c388940..8db6ae1 100644 --- a/django_pyscss/extension/django.py +++ b/django_pyscss/extension/django.py @@ -1,5 +1,7 @@ from __future__ import absolute_import, unicode_literals +import os + from itertools import product from pathlib import PurePath @@ -19,10 +21,11 @@ class DjangoExtension(CoreExtension): """ original_path = PurePath(name) - if original_path.suffix: - search_exts = [original_path.suffix] + search_exts = list(compilation.compiler.dynamic_extensions) + if original_path.suffix and original_path.suffix in search_exts: + basename = original_path.stem else: - search_exts = compilation.compiler.dynamic_extensions + basename = original_path.name if original_path.is_absolute(): # Remove the beginning slash @@ -30,12 +33,10 @@ class DjangoExtension(CoreExtension): elif rule.source_file.origin: search_path = rule.source_file.origin if original_path.parent: - search_path = search_path / original_path.parent + search_path = os.path.normpath(str(search_path / original_path.parent)) else: search_path = original_path.parent - basename = original_path.stem - for prefix, suffix in product(('_', ''), search_exts): filename = PurePath(prefix + basename + suffix) |