How to use the sigal.utils.cached_property function in sigal

To help you get started, we’ve selected a few sigal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github saimn / sigal / sigal / gallery.py View on Github external
    @cached_property
    def exif(self):
        datetime_format = self.settings['datetime_format']
        return (get_exif_tags(self.raw_exif, datetime_format=datetime_format)
                if self.raw_exif and self.ext in ('.jpg', '.jpeg') else None)
github saimn / sigal / sigal / plugins / zip_gallery.py View on Github external
def nozip_gallery_file(album, settings=None):
    """Filesystem based switch to disable ZIP generation for an Album"""
    Album.zip = cached_property(generate_album_zip)
github saimn / sigal / sigal / gallery.py View on Github external
    @cached_property
    def date(self):
        return (self.exif and self.exif.get('dateobj', None) or
                self._get_file_date())
github saimn / sigal / sigal / gallery.py View on Github external
    @cached_property
    def raw_exif(self):
        try:
            return (get_exif_data(self.src_path)
                    if self.ext in ('.jpg', '.jpeg') else None)
        except Exception as e:
            self.logger.warning('Could not read EXIF data from %s: %s',
                                self.src_path, e)
github saimn / sigal / sigal / gallery.py View on Github external
    @cached_property
    def size(self):
        return get_size(self.dst_path)
github saimn / sigal / sigal / gallery.py View on Github external
    @cached_property
    def thumb_size(self):
        return get_size(self.thumb_path)
github saimn / sigal / sigal / gallery.py View on Github external
    @cached_property
    def zip(self):
        """Placeholder ZIP method.
        The ZIP logic is controlled by the zip_gallery plugin
        """
        return None