Exemple #1
0
  def _check_dependencies(self):

    imgmin = exists('imgmin')
    image_optim = exists('image_optim')

    if not imgmin or not image_optim:
      puts(p('Dependencies have not been installed:'))

      with indent(3):
        message = 'imgmin - https://github.com/rflynn/imgmin'
        message = s('✓ ' + message) if imgmin else e('✗ ' + message)
        puts(message)

        message = 'image_optim - http://rubygems.org/gems/image_optim'
        message = s('✓ ' + message) if image_optim else e('✗ ' + message)
        puts(message)

      sys.exit(1)
Exemple #2
0
 def show_statistics(self):
     """Show statistics of the optimizations"""
     puts("\nFiles: %s (PNGs %s/JPGs %s/GIFs %s)" % (
         s(self.files),
         s(self.pngs),
         s(self.jpgs),
         s(self.gifs)
     ))
     puts("Original Size: %s" % s(round(self.pre_size, 2)))
     puts("New Size: %s" % s(round(self.post_size, 2)))
     puts("Savings: %s%%" % s(self._get_savings()))
Exemple #3
0
  def show(self):
    puts(p("Statistics:"))

    with indent(3):
      puts("Total Files: %s (PNGs %s/JPGs %s/GIFs %s)" % (
        s(self.files),
        s(self.pngs),
        s(self.jpgs),
        s(self.gifs)
      ))
      puts("Original File/Folder Size: %s" % s(round(self.preSize, 2)))
      puts("New File/Folder Size: %s" % s(round(self.postSize, 2)))
      puts("Savings of: %s%%" % s(self._getSavings()))