jasy.style.output package

Submodules

jasy.style.output.Compressor module

class jasy.style.output.Compressor.Compressor(optimize=None, format=None)[source]

Bases: object

compress(node)[source]

Compresses the given node and returns the compressed text result.

indent(code)[source]

Indents the given code by the current indenting setup.

type_block(node)[source]
type_call(node)[source]
type_comma(node)[source]
type_expr(node)[source]
type_fontface(node)[source]
type_frame(node)[source]
type_function(node)[source]
type_identifier(node)[source]
type_keyframes(node)[source]
type_list(node)[source]
type_media(node)[source]
type_mixin(node)[source]
type_number(node)[source]
type_page(node)[source]
type_property(node)[source]
type_raw(node)[source]
type_selector(node)[source]
type_sheet(node)[source]
type_slash(node)[source]
type_string(node)[source]
type_supports(node)[source]
exception jasy.style.output.Compressor.CompressorError(message, node)[source]

Bases: Exception

jasy.style.output.Formatting module

class jasy.style.output.Formatting.Formatting(*args)[source]

Bases: jasy.core.FlagSet.FlagSet

Configures an formatting object which can be used to compress stylesheets afterwards.

The optimization set is frozen after initialization which also generates the unique key based on the given formatting options.

jasy.style.output.Optimization module

exception jasy.style.output.Optimization.Error(msg)[source]

Bases: Exception

Error object which is raised whenever an optimization could not be applied correctly.

class jasy.style.output.Optimization.Optimization(*args)[source]

Bases: jasy.core.FlagSet.FlagSet

Configures an optimization object which can be used to compress stylesheets afterwards.

The optimization set is frozen after initialization which also generates the unique key based on the given optimizations.

apply(tree)[source]

Applies the configured optimizations to the given node tree.

Modifies the tree in-place to be sure to have a deep copy if you need the original one. It raises an error instance whenever any optimization could not be applied to the given tree.

Module contents