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)
def _show_help(self): puts(e("Usage: %s [options] <file/folder>" % sys.argv[0])) with indent(3): puts(p("--help ") + "Show the help system") puts(p("--lossy ") + "Apply a lossy optimization on the image(s)") puts(p("--lossless ") + "Apply a lossless optimization on the image(s)") puts(p("--watch ") + "Watch a folder and apply optimizations straight up") puts(p("--stats ") + "Show stats of the optimizations") sys.exit(1)