Sass compile helper¶
This is not a real compiler, just an helper wrapping common methods to compile a Sass source using libsass-python.
- class boussole.compiler.SassCompileHelper[source]¶
Sass compile helper mixin
- safe_compile(settings, sourcepath, destination)[source]¶
Safe compile
It won’t raise compile error and instead return compile success state as a boolean with a message.
It will create needed directory structure first if it contain some directories that does not allready exists.
- Parameters
settings (boussole.conf.model.Settings) – Project settings.
sourcepath (str) – Source file path to compile to CSS.
destination (str) – Destination path for compiled CSS.
- Returns
A tuple of (success state, message).
success state: is boolean weither the compile is a success or not;
message: Message accorded to success. If compile fails, the message will contains returned error from libsass, if success just the destination path.
- Return type
tuple
- write_content(content, destination)[source]¶
Write given content to destination path.
It will create needed directory structure first if it contain some directories that does not allready exists.
- Parameters
content (str) – Content to write to target file.
destination (str) – Destination path for target file.
- Returns
Path where target file has been written.
- Return type
str