# Path: sigal/signals.py



import logging
import os
from sigal import signals
        except OSError:
            # directory was created and populated with images in a
            # previous run => keep it
            pass

        # cannot set albums => empty subdirs so that no albums are
        # generated
        album.subdirs = []
        album.medias = []

    else:
        with open(nomediapath) as nomediaFile:
            logger.info("Found a .nomedia file in %s, ignoring its entries", album.name)
            ignored = nomediaFile.read().split("\n")

            album.medias = [
                media for media in album.medias if media.src_filename not in ignored
            ]
            album.subdirs = [
                dirname for dirname in album.subdirs if dirname not in ignored
            ]

            # subdirs have been added to the gallery already, remove
            # them there, too
            _remove_albums_with_subdirs(
                album.gallery.albums, ignored, album.path + os.path.sep
            )


def register(settings):

# Path: sigal/signals.py



# Path: sigal/plugins/nomedia.py
import logging
import os
from sigal import signals

        except OSError:
            # directory was created and populated with images in a
            # previous run => keep it
            pass

        # cannot set albums => empty subdirs so that no albums are
        # generated
        album.subdirs = []
        album.medias = []

    else:
        with open(nomediapath) as nomediaFile:
            logger.info("Found a .nomedia file in %s, ignoring its entries", album.name)
            ignored = nomediaFile.read().split("\n")

            album.medias = [
                media for media in album.medias if media.src_filename not in ignored
            ]
            album.subdirs = [
                dirname for dirname in album.subdirs if dirname not in ignored
            ]

            # subdirs have been added to the gallery already, remove
            # them there, too
            _remove_albums_with_subdirs(
                album.gallery.albums, ignored, album.path + os.path.sep
            )


def register(settings):

    signals.album_initialized.connect(filter_nomedia)