def handle_noargs(self, **options): for image in get_image_files(): if not os.path.isfile(get_thumb_filename(image)): print "Creating thumbnail for %s" % image try: create_thumbnail(image) except Exception, e: print "Couldn't create thumbnail for %s: %s" % (image, e)
def handle_noargs(self, **options): for image in get_image_files(): if not os.path.isfile(get_thumb_filename(image)): self.stdout.write("Creating thumbnail for {0}".format(image)) try: create_thumbnail(image) except Exception as e: self.stdout.write("Couldn't create thumbnail for {0}: {1}".format(image, e)) self.stdout.write("Finished")
def handle(self, *args, **options): if getattr(settings, 'CKEDITOR_IMAGE_BACKEND', None): backend = get_backend() for image in get_image_files(): if not self._thumbnail_exists(image): self.stdout.write("Creating thumbnail for %s" % image) try: backend.create_thumbnail(image) except Exception as e: self.stdout.write("Couldn't create thumbnail for %s: %s" % (image, e)) self.stdout.write("Finished") else: self.stdout.write("No thumbnail backend is enabled")
def handle_noargs(self, **options): if getattr(settings, 'CKEDITOR_IMAGE_BACKEND', None): backend = get_backend() for image in get_image_files(): if not os.path.isfile(get_thumb_filename(image)): self.stdout.write("Creating thumbnail for {0}".format(image)) try: backend.create_thumbnail(image) except Exception as e: self.stdout.write("Couldn't create thumbnail for {0}: {1}".format(image, e)) self.stdout.write("Finished") else: self.stdout.write("No thumbnail backend is enabled")
def handle_noargs(self, **options): if getattr(settings, 'CKEDITOR_IMAGE_BACKEND', None): backend = get_backend() for image in get_image_files(): if not self._thumbnail_exists(image): self.stdout.write("Creating thumbnail for %s" % image) try: backend.create_thumbnail(image) except Exception as e: self.stdout.write("Couldn't create thumbnail for %s: %s" % (image, e)) self.stdout.write("Finished") else: self.stdout.write("No thumbnail backend is enabled")