File: sass.py

package info (click to toggle)
django-pipeline 4.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 904 kB
  • sloc: python: 3,170; makefile: 120; javascript: 59
file content (15 lines) | stat: -rw-r--r-- 499 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from os.path import dirname

from pipeline.compilers import SubProcessCompiler
from pipeline.conf import settings


class SASSCompiler(SubProcessCompiler):
    output_extension = "css"

    def match_file(self, filename):
        return filename.endswith((".scss", ".sass"))

    def compile_file(self, infile, outfile, outdated=False, force=False):
        command = (settings.SASS_BINARY, settings.SASS_ARGUMENTS, infile, outfile)
        return self.execute_command(command, cwd=dirname(infile))