summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRocky Meza <rocky@fusionbox.com>2014-02-03 19:37:18 -0700
committerRocky Meza <rocky@fusionbox.com>2014-02-03 19:37:18 -0700
commitd7e1e50165e180bb795f1c3dde1ae684df4e56d8 (patch)
tree24ec8db3e8179cbd82b972f61f16ca1e201529aa
parent6b2ea386888c57b38001ec80442cc5b8096f9117 (diff)
downloaddjango-pyscss-d7e1e50165e180bb795f1c3dde1ae684df4e56d8.tar.gz
Removed find_one_file
-rw-r--r--django_pyscss/scss.py13
-rw-r--r--django_pyscss/utils.py5
2 files changed, 8 insertions, 10 deletions
diff --git a/django_pyscss/scss.py b/django_pyscss/scss.py
index 1185f10..21e6c65 100644
--- a/django_pyscss/scss.py
+++ b/django_pyscss/scss.py
@@ -9,7 +9,7 @@ from scss import (
Scss, dequote, log, SourceFile, SassRule, config,
)
-from django_pyscss.utils import find_one_file, find_all_files
+from django_pyscss.utils import find_all_files
# TODO: It's really gross to modify this global settings variable.
@@ -38,9 +38,13 @@ class DjangoScss(Scss):
pass
if staticfiles_storage.exists(filename):
return filename, staticfiles_storage
+ else:
+ return None, None
def get_file_from_finders(self, filename):
- return find_one_file(filename)
+ for file_and_storage in find_all_files(filename):
+ return file_and_storage
+ return None, None
def get_file_and_storage(self, filename):
# TODO: the switch probably shouldn't be on DEBUG
@@ -73,9 +77,8 @@ class DjangoScss(Scss):
def _find_source_file(self, filename, relative_to=None):
for name in self.get_possible_import_paths(filename, relative_to):
- file_and_storage = self.get_file_and_storage(name)
- if file_and_storage:
- full_filename, storage = file_and_storage
+ full_filename, storage = self.get_file_and_storage(name)
+ if full_filename:
if name not in self.source_files:
with storage.open(full_filename) as f:
source = f.read()
diff --git a/django_pyscss/utils.py b/django_pyscss/utils.py
index b6358cd..e8d45ce 100644
--- a/django_pyscss/utils.py
+++ b/django_pyscss/utils.py
@@ -14,8 +14,3 @@ def find_all_files(glob):
for path, storage in finder.list([]):
if fnmatch.fnmatchcase(path, glob):
yield path, storage
-
-
-def find_one_file(path):
- for file in find_all_files(path):
- return file