Assets registry

class optimus.assets.registry.AssetRegistry[source]

Index all knowed files from registered bundles

map_dest_to_bundle

Registry of asset paths associated to their asset bundle keyname.

Type:dict
logger

Optimus logger.

Type:logging.Logger
add_bundle(name, bundle)[source]

Add a bundle to the registry

Parameters:
  • name (string) – Bundle name as defined in the assets map.
  • bundle (webassets.Bundle) – Bundle to associate to given name.
optimus.assets.registry.register_assets(settings)[source]

Initialize webassets environment and its bundles.

Parameters:settings (conf.model.SettingsModel) – Settings registry instance.
Returns:New configured Webasset environment.
Return type:webassets.Environment
class optimus.assets.rcssmin_webassets_filter.RCSSMin(**kwargs)[source]

Minifies CSS using ‘rcssmin’ library.

Requires the rcssmin package (https://github.com/ndparker/rcssmin).

This is a simple webassets filter that has been merged but not released yet, so we ship it until new package release since ‘cssmin’ is totally outdated and doesn’t work with Python 3.