versatileimagefield/image_warmer.py
def warm(self):
        """
        Returns a 2-tuple:
        [0]: Number of images successfully pre-warmed
        [1]: A list of paths on the storage class associated with the
             VersatileImageField field being processed by `self` of
             files that could not be successfully seeded.
        """
        num_images_pre_warmed = 0
        failed_to_create_image_path_list = []
        total = self.queryset.count() * len(self.size_key_list)
        for a, instance in enumerate(self.queryset, start=1):
            for b, size_key in enumerate(self.size_key_list, start=1):
                success, url_or_filepath = self._prewarm_versatileimagefield(
                    size_key,
                    reduce(getattr, self.image_attr.split("."), instance)
                )
                if success is True:
                    num_images_pre_warmed += 1
                    if self.verbose:
                        cli_progress_bar(num_images_pre_warmed, total)
                else:
                    failed_to_create_image_path_list.append(url_or_filepath)

                if a * b == total:
                    stdout.write('\n')

        stdout.flush()
        return (num_images_pre_warmed, failed_to_create_image_path_list)
def warm(self):
        """
        Returns a 2-tuple:
        [0]: Number of images successfully pre-warmed
        [1]: A list of paths on the storage class associated with the
             VersatileImageField field being processed by `self` of
             files that could not be successfully seeded.
        """
        num_images_pre_warmed = 0
        failed_to_create_image_path_list = []
        total = self.queryset.count() * len(self.size_key_list)
        for a, instance in enumerate(self.queryset, start=1):
            for b, size_key in enumerate(self.size_key_list, start=1):
                success, url_or_filepath = self._prewarm_versatileimagefield(
                    size_key,
                    reduce(getattr, self.image_attr.split("."), instance)
                )
                if success is True:
                    num_images_pre_warmed += 1
                    if self.verbose:
                        cli_progress_bar(num_images_pre_warmed, total)
                else:
                    failed_to_create_image_path_list.append(url_or_filepath)

                if a * b == total:
                    stdout.write('\n')

        stdout.flush()
        return (num_images_pre_warmed, failed_to_create_image_path_list)
def warm ( self ) : num_images_pre_warmed = 0 failed_to_create_image_path_list = [ ] total = self . queryset . count ( ) * len ( self . size_key_list ) for a , instance in enumerate ( self . queryset , start = 1 ) : for b , size_key in enumerate ( self . size_key_list , start = 1 ) : success , url_or_filepath = self . _prewarm_versatileimagefield ( size_key , reduce ( getattr , self . image_attr . split ( "." ) , instance ) ) if success is True : num_images_pre_warmed += 1 if self . verbose : cli_progress_bar ( num_images_pre_warmed , total ) else : failed_to_create_image_path_list . append ( url_or_filepath ) if a * b == total : stdout . write ( '\n' ) stdout . flush ( ) return ( num_images_pre_warmed , failed_to_create_image_path_list )
Returns a 2-tuple:
        [0]: Number of images successfully pre-warmed
        [1]: A list of paths on the storage class associated with the
             VersatileImageField field being processed by `self` of
             files that could not be successfully seeded.
Returns a 2 - tuple : [ 0 ] : Number of images successfully pre - warmed [ 1 ] : A list of paths on the storage class associated with the VersatileImageField field being processed by self of files that could not be successfully seeded .