Jump to >

This documentation covers Djblets 2.0. You can see the latest Djblets documentation or all other versions.


class LessCompiler(verbose, storage)[source]

Bases: pipeline.compilers.less.LessCompiler

A LESS compiler which doesn’t redirect the output.

Pipeline’s LESS compiler outputs to stdout and redirects that output to the target file, because of some bug in old versions of lessc. We don’t want to do that, because it interferes with the generation of sourcemaps.

To use this, add the path to this class to settings.PIPELINE['COMPILERS'].

__init__(verbose, storage)[source]

x.__init__(…) initializes x; see help(type(x)) for signature


__init__(verbose, storage) x.__init__(…) initializes x; see help(type(x)) for signature
compile_file(infile, outfile[, outdated, force]) Compile a given file.
execute_command(command[, cwd, stdout_captured]) Execute a command at cwd, saving its normal output at stdout_captured.
is_outdated(infile, outfile) Check to see if the given file is outdated.
output_path(path, extension)
save_file(path, content)


compile_file(infile, outfile, outdated=False, force=False)[source]

Compile a given file.

  • infile (unicode) – The input filename.
  • outfile (unicode) – The output filename.
  • outdated (bool) – Whether the file is outdated.
  • force (bool) – Whether the compilation should proceed, regardless of whether the file is out of date.
is_outdated(infile, outfile)[source]

Check to see if the given file is outdated.

This will compare the timestamps of the infile and outfile, but also compare the timestamp of outfile against any import depedencies that exist.

  • infile (unicode) – The path to the input file.
  • outfile (unicode) – The path to the output file.

True if the file is out of date and needs to be recompiled.

Return type: