# Path: sigal/signals.py



import gzip
import logging
import os
import shutil
        import zopfli.gzip
        import brotli
            import zopfli.gzip  # noqa
            import brotli  # noqa
from click import progressbar
from sigal import signals
    compress_settings = gallery.settings.get(
        'compress_assets_options', DEFAULT_SETTINGS
    )
    compressor = get_compressor(compress_settings)

    if compressor is None:
        return

    # Collecting theme assets
    theme_assets = []
    for current_directory, _, filenames in os.walk(
        os.path.join(gallery.settings['destination'], 'static')
    ):
        for filename in filenames:
            theme_assets.append(os.path.join(current_directory, filename))

    with progressbar(
        length=len(gallery.albums) + len(theme_assets), label='Compressing static files'
    ) as bar:
        for album in gallery.albums.values():
            compressor.compress(os.path.join(album.dst_path, album.output_file))
            bar.update(1)

        for theme_asset in theme_assets:
            compressor.compress(theme_asset)
            bar.update(1)


def register(settings):
    if settings['write_html']:

# Path: sigal/signals.py



# Path: sigal/plugins/compress_assets.py
import gzip
import logging
import os
import shutil
        import zopfli.gzip
        import brotli
            import zopfli.gzip  # noqa
            import brotli  # noqa
from click import progressbar
from sigal import signals

    compress_settings = gallery.settings.get(
        'compress_assets_options', DEFAULT_SETTINGS
    )
    compressor = get_compressor(compress_settings)

    if compressor is None:
        return

    # Collecting theme assets
    theme_assets = []
    for current_directory, _, filenames in os.walk(
        os.path.join(gallery.settings['destination'], 'static')
    ):
        for filename in filenames:
            theme_assets.append(os.path.join(current_directory, filename))

    with progressbar(
        length=len(gallery.albums) + len(theme_assets), label='Compressing static files'
    ) as bar:
        for album in gallery.albums.values():
            compressor.compress(os.path.join(album.dst_path, album.output_file))
            bar.update(1)

        for theme_asset in theme_assets:
            compressor.compress(theme_asset)
            bar.update(1)


def register(settings):
    if settings['write_html']:

        signals.gallery_build.connect(compress_gallery)