X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/575e58df64c98b53edca9fb6a29b284dbc375609..28cb104054903726b0556222929f8f2e9941882d:/lib/pyscss_compiler.py diff --git a/lib/pyscss_compiler.py b/lib/pyscss_compiler.py new file mode 100644 index 000000000..b57d59e0b --- /dev/null +++ b/lib/pyscss_compiler.py @@ -0,0 +1,19 @@ +from os.path import dirname +from django.conf import settings +from pipeline.compilers import SubProcessCompiler + + +class PySCSSCompiler(SubProcessCompiler): + output_extension = 'css' + + def match_file(self, filename): + return filename.endswith('.scss') + + def compile_file(self, infile, outfile, outdated=False, force=False): + command = "%s %s < %s > %s" % ( + settings.PIPELINE_PYSCSS_BINARY, + settings.PIPELINE_PYSCSS_ARGUMENTS, + infile, + outfile + ) + return self.execute_command(command, cwd=dirname(infile))