diff options
-rw-r--r-- | scss/compiler.py | 8 | ||||
-rw-r--r-- | scss/source.py | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/scss/compiler.py b/scss/compiler.py index 82c5390..551f407 100644 --- a/scss/compiler.py +++ b/scss/compiler.py @@ -195,6 +195,14 @@ class Compiler(object): compilation.add_source(source) return self.call_and_catch_errors(compilation.run) + def compile_sources(self, *sources): + # TODO this api is not the best please don't use it. this all needs to + # be vastly simplified, still, somehow. + compilation = self.make_compilation() + for source in sources: + compilation.add_source(source) + return self.call_and_catch_errors(compilation.run) + def compile_string(self, string): source = SourceFile.from_string(string) compilation = self.make_compilation() diff --git a/scss/source.py b/scss/source.py index a3725f8..7f99c1f 100644 --- a/scss/source.py +++ b/scss/source.py @@ -5,7 +5,6 @@ from __future__ import division import hashlib import logging -import os from pathlib import Path import re @@ -43,6 +42,11 @@ class MISSING(object): MISSING = MISSING() +# TODO i'm still not entirely happy with this, nor with the concept of an +# "origin". it should really be a "loader", with a defined API. also, even +# with all these helpful classmethods, i'm still having to do a lot of manual +# mucking around in django-pyscss, where all i'm given is a file path and a +# string of the contents, and i want to /not/ re-read the file. class SourceFile(object): """A single input file to be fed to the compiler. Detects the encoding (according to CSS spec rules) and performs some light pre-processing. |