summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerman M. Bravo <german.mb@deipi.com>2015-07-19 07:54:06 -0500
committerGerman M. Bravo <german.mb@deipi.com>2015-07-19 07:54:06 -0500
commitb1621dca6b554d793f01eee7831997ae477ca7ec (patch)
tree8f6898b7c948606be05089952bab5557fcf822ae
parent09a83d1da6a627e7af02ab2906578054e1b67f11 (diff)
downloadpyscss-b1621dca6b554d793f01eee7831997ae477ca7ec.tar.gz
Added source_files to legacy compiler
-rw-r--r--scss/legacy.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/scss/legacy.py b/scss/legacy.py
index b155330..ec4fd72 100644
--- a/scss/legacy.py
+++ b/scss/legacy.py
@@ -3,7 +3,9 @@ from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
+import os
from pathlib import Path
+from collections import namedtuple
import six
@@ -43,6 +45,8 @@ _default_scss_vars = {
'$--curlybracketclosed': String.unquoted('}'),
}
+SourceFileTuple = namedtuple('SourceFileTuple', ('parent_dir', 'filename'))
+
# TODO using this should spew an actual deprecation warning
class Scss(object):
@@ -182,7 +186,9 @@ class Scss(object):
source = SourceFile.from_string(contents, relpath=name)
compilation.add_source(source)
- return compiler.call_and_catch_errors(compilation.run)
+ compiled = compiler.call_and_catch_errors(compilation.run)
+ self.source_files = list(SourceFileTuple(*os.path.split(s.path)) for s in compilation.source_index.values())
+ return compiled
# Old, old alias
Compilation = compile