diff options
author | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2014-10-13 15:04:52 -0700 |
---|---|---|
committer | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2014-10-13 15:04:52 -0700 |
commit | 0bb2b63aa9de9ab58a2cfc0be0525f8f9a8f113b (patch) | |
tree | b344d2b906e416c09e472575acae775634b2f03b | |
parent | d3366e69c90701d6bf1f53497a2fb8cec8d40c4e (diff) | |
download | pyscss-0bb2b63aa9de9ab58a2cfc0be0525f8f9a8f113b.tar.gz |
Allow both Paths and strings.
-rw-r--r-- | scss/compiler.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scss/compiler.py b/scss/compiler.py index 50602d2..c3c2ab5 100644 --- a/scss/compiler.py +++ b/scss/compiler.py @@ -92,7 +92,7 @@ class Compiler(object): loops_have_own_scopes=True, undefined_variables_fatal=True, super_selector='', - ): + ): """Configure a compiler. :param root: Directory to treat as the "project root". Search paths @@ -103,9 +103,9 @@ class Compiler(object): to ``root``. Absolute and parent paths are allowed here, but ``@import`` will refuse to load files that aren't in one of the directories here. Defaults to only the root. - :type search_path: list of :class:`pathlib.Path` objects, or something - that implements a similar interface (useful for custom pseudo - filesystems) + :type search_path: list of strings, :class:`pathlib.Path` objects, or + something that implements a similar interface (useful for custom + pseudo filesystems) """ # TODO perhaps polite to automatically cast any string paths to Path? # but have to be careful since the api explicitly allows dummy objects. @@ -147,6 +147,8 @@ class Compiler(object): self.super_selector = super_selector def normalize_path(self, path): + if isinstance(path, six.string_types): + path = Path(path) if path.is_absolute(): return path if self.root is None: |