-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed all files to use 4spaces instead of 2spaces
- Loading branch information
Josh Benham
committed
May 22, 2012
1 parent
a6ca937
commit 9d1e824
Showing
7 changed files
with
114 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,22 +1,21 @@ | |||
# -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||
# vim: sw=2 ts=2 | |||
|
|
||
from setuptools import setup, find_packages | from setuptools import setup, find_packages | ||
|
|
||
with open('README.md') as f: | with open('README.md') as f: | ||
readme = f.read() | readme = f.read() | ||
|
|
||
with open('LICENSE') as f: | with open('LICENSE') as f: | ||
license = f.read() | license = f.read() | ||
|
|
||
setup( | setup( | ||
name='squish', | name='squish', | ||
version='0.0.1', | version='0.0.1', | ||
description='Simple image optimization tool', | description='Simple image optimization tool', | ||
long_description=readme, | long_description=readme, | ||
author='Josh Benham', | author='Josh Benham', | ||
author_email='joshbenham@gmail.com', | author_email='joshbenham@gmail.com', | ||
url='https://github.com/joshbenham/squish', | url='https://github.com/joshbenham/squish', | ||
license=license, | license=license, | ||
packages=find_packages(exclude=('tests', 'docs')) | packages=find_packages(exclude=('tests', 'docs')) | ||
) | ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,18 +1,17 @@ | |||
#!/usr/bin/env python | #!/usr/bin/env python | ||
# -*- coding: utf-8 -*- # | # -*- coding: utf-8 -*- # | ||
# vim: sw=2 ts=2 | |||
|
|
||
from clint.textui import colored | from clint.textui import colored | ||
|
|
||
|
|
||
def e(s): | def e(s): | ||
"""Color: Error""" | """Color: Error""" | ||
return colored.red(s) | return colored.red(s) | ||
|
|
||
def s(s): | def s(s): | ||
"""Color: Success""" | """Color: Success""" | ||
return colored.green(s) | return colored.green(s) | ||
|
|
||
def p(s): | def p(s): | ||
"""Color: Primary""" | """Color: Primary""" | ||
return colored.cyan(s) | return colored.cyan(s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,18 +1,19 @@ | |||
#!/usr/bin/env python | #!/usr/bin/env python | ||
# -*- coding: utf-8 -*- # | # -*- coding: utf-8 -*- # | ||
# vim: sw=2 ts=2 | |||
|
|
||
import envoy | import envoy | ||
|
|
||
from PIL import Image | from PIL import Image | ||
|
|
||
|
|
||
def exists(string): | def exists(string): | ||
return envoy.run("which %s" % string).status_code == 0 | """Check to see if file exists""" | ||
return envoy.run("which %s" % string).status_code == 0 | |||
|
|
||
def isimage(file): | def isimage(file): | ||
try: | """Check to see if image exists""" | ||
Image.open(file) | try: | ||
return True | Image.open(file) | ||
except IOError: | return True | ||
return False | except IOError: | ||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,16 +1,15 @@ | |||
#!/usr/bin/env python | #!/usr/bin/env python | ||
# -*- coding: utf-8 -*- # | # -*- coding: utf-8 -*- # | ||
# vim: sw=2 ts=2 | |||
|
|
||
import envoy | import envoy | ||
|
|
||
|
|
||
class Optimize: | class Optimize: | ||
|
|
||
@staticmethod | @staticmethod | ||
def lossy(file): | def lossy(file): | ||
envoy.run("imgmin %s %s" % (file, file)) | envoy.run("imgmin %s %s" % (file, file)) | ||
|
|
||
@staticmethod | @staticmethod | ||
def lossless(file): | def lossless(file): | ||
envoy.run("image_optim %s" % file) | envoy.run("image_optim %s" % file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9d1e824
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\o/