b57d59e0b0dedc0c4f0428f5803f1f38a528886b
[wolnelektury.git] / lib / pyscss_compiler.py
1 from os.path import dirname
2 from django.conf import settings
3 from pipeline.compilers import SubProcessCompiler
4
5
6 class PySCSSCompiler(SubProcessCompiler):
7     output_extension = 'css'
8
9     def match_file(self, filename):
10         return filename.endswith('.scss')
11
12     def compile_file(self, infile, outfile, outdated=False, force=False):
13         command = "%s %s < %s > %s" % (
14             settings.PIPELINE_PYSCSS_BINARY,
15             settings.PIPELINE_PYSCSS_ARGUMENTS,
16             infile,
17             outfile
18         )
19         return self.execute_command(command, cwd=dirname(infile))